Skip to content
#

orm

Here are 2,436 public repositories matching this topic...

jy95
jy95 commented Dec 29, 2019

Issue Description

Is your feature request related to a problem? Please describe.

When doing some migrations, I would like to delete a column created in a previous migration.
However, this is not possible with the current code for some scenarios.

An example :
migration v3

'use strict';

let opts = {tableName: 'Exercises'};

module.exports = {
    up: (queryInterf
aaronfulkerson
aaronfulkerson commented Aug 12, 2019

Issue type:

[ ] question
[ ] bug report
[ ] feature request
[x] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

medyagh
medyagh commented Jan 4, 2020

followed the docs for has manyhttp://gorm.io/docs/has_many.html for sqlilite

package main

import (
	"fmt"

	"github.com/jinzhu/gorm"
	_ "github.com/mattn/go-sqlite3"
)


type User struct {
	Id          string
	Name        string
	CreditCards []CreditCard `gorm:"FOREIGNKEY:user_id;ASSOCIATION_FOREIGNKEY:id"`
}

type CreditCard struct {
	Id     int
	Number string
	UserID 
andrew-knott
andrew-knott commented Feb 18, 2020

The documentation for Importing NDF format data does not mention that the method will not be supported in future as per the message in the 'prisma import' command...

"Warning: The prisma import command will not be further developed in the future. Please use the native import features of your database for these workflows. "

https://www.prisma.io/docs/prisma-cli-and-configuration/data-import

linhub15
linhub15 commented Feb 25, 2020

Asynchronously returns the only element of a sequence, and throws an InvalidOperationException exception if there is not exactly one element in the sequence.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: d3b7deb0-a592-b6dc-1564-fba73a4dcb4c
  • Version Independent ID: 1836b7d9-419e-d8a4-51ff-09f504a56462
  • Content: [E
willvousden
willvousden commented Oct 13, 2018

Is the README the only documentation available for this project? I find myself having to read the source to understand the interface and features that are available (e.g., context managers, bulk_query, etc.).

In the case of bulk_query, the arguments are simply passed through to the underlying SQLAlchemy engine, with no explanation. I tracked it down in [SQLAlchemy's documentation](https:/

frames75
frames75 commented Feb 19, 2020

In the tutorial events there is this example:

const User = bookshelf.model('User', {
  tableName: 'users',

  initialize() {
    this.on('saving', (model) => {
      return User.forge({email: model.get('email')}).fetch().then((user) => {
        if (user) 
            throw new Error('That email address already exists')
    
lukaseder
lukaseder commented Dec 4, 2019

Starting with jOOQ 3.12, we now generate JSON or JSONB types in generated code. If someone wanted to apply a custom binding, they should no longer use Binding<Object, Something>, but now need to use Binding<JSON[B], Something>. E.g.:


AdityaAnand1
AdityaAnand1 commented Feb 13, 2020

Here's the use case:

  1. Try to connect to DB X
  2. First check if it exists
    2.1 If it exists, go ahead and connect to it
    2.2 If it does not exists, create it and then connect to it

This would be essential in building a resilient system which would allow spinning up new environments quickly with no manual processes involved. I'm picturing spinning up dev/staging/prod environments with auto-

alchemistake
alchemistake commented Feb 21, 2020

We have a abstract class in our codebase that is expanded by many documents. There is a post_save procedure we want to add to every single one of the documents that expands the base class.
Is there a way to do it?

Do I need to add signals.post_save.connectevery doc we have which will decrease maintainability on our side, I don't want to break the whole system I'm working on.

alexey-sh
alexey-sh commented Sep 7, 2017

From the documentation:

Sometimes you want to be able to access an association from the opposite model. In the case of the example above, from the Person. You can do this by passing an option to the association.

Animal.hasOne('owner', Person, { reverse: "pets" });
After this, every person has now 2 convenience methods:

getPets(callback) - get all animals associated with the p

videni
videni commented Sep 29, 2019

what is prefer way to add relation and remove relation? I found example as below, but I did't find any document about the two methods.

 case 'ADD_AUTHOR_TO_BOOK':
        Book.withId(action.payload.bookId).authors.add(action.payload.author);  // add new entity ,  add relation?  this doesn't work.
        break;
    case 'REMOVE_AUTHOR_FROM_BOOK':
        Book.withId(action.payload.bo
mickeyreiss
mickeyreiss commented Jul 2, 2019

It would be helpful to pull comments from tables and column, and if they are present, write them as comments in the generated go code. This will help with documentation and follow the design goal: the schema is the source of truth.

If this is interesting, I can help with the mysql implementation.

stub42
stub42 commented May 15, 2017

With PostgreSQL, a table consisting of a single column that is the primary key is not getting the PrimaryKey attribute set in templates/postgres.type.go.tpl. The _exists and _deleted variables are not created and update and upsert methods can not be created.

// SubnetName represents a row from 'public.subnetname'.
type SubnetName struct {
	SubnetName string `json:"subnet_name"` // subn

Improve this page

Add a description, image, and links to the orm topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the orm topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.