Skip to content
#

orm

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

jy95
jy95 commented Dec 15, 2019

Issue Description

What are you doing?

I have a model that contained precomputed fields including a column that is an array of int (tags_ids). Here is its definition :

'use strict';

// This sub table is useful to save computation times for search
module.exports = (sequelize, DataTypes) => {
    let Exercise_Metrics = sequelize.define('Exercise_Metrics', {
        // 
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 
alapini
alapini commented Mar 12, 2020

Describe the bug
I'm not sure if I'm missing something but I can't generate a simple many-to-many relationship with prisma 1.34.10. It throws ✖ Valid values for the argument link are: INLINE.

To Reproduce
Steps to reproduce the behavior (MacOS):

$brew tap prisma/prisma
$brew install prisma
$prisma --version
Prisma CLI version: prisma/1.34.10 (darwin-x64) node-v1
gorgi
gorgi commented Mar 20, 2020

Currently, it is very confusing how to use this new method. More thorough exemples will help us understand the right usage of this method.


Document Details

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

  • ID: 8243b953-5de7-3123-0737-9be4ca3c08fd
  • Version Independent ID: 1d1c0196-70ac-a45e-d1b7-48c55963f612
  • Content: [RelationalDatabaseFaca
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')
    
sgrif
sgrif commented Feb 18, 2020

Given that we support CURRENT_TIMESTAMP, the lack of CURRENT_DATE feels like an omission. While you can hack it with date(now), I keep finding myself wishing there was a direct way to reference this. Given that now means CURRENT_TIMESTAMP, I think there's precedent for today meaning CURRENT_DATE. This is supported by all backends we support (and is in the ISO standard I believe).

ash-perfect
ash-perfect commented Mar 26, 2020

The order of defining classes is giving an error, it shouldn't right?

class Order2(EmbeddedDocument):
    pass

class TableOrder2(Document):
    table = ReferenceField(Table)
    orders = ListField(EmbeddedDocumentField(Order2))
    timestamp = DateTimeField(default=datetime.datetime.now())
    
class Order2(EmbeddedDocument):
    food1 = StringField()
    food2=StringField()

maritaria
maritaria commented Sep 26, 2017
	let User = db.define("user", {
		name: { type: "text", required: true, unique: true },
		task_name: String,
		task_data: Object,
		last_seen: { type: 'date', time: true },
		card_url: { type: 'text' },
	});
	
	let Group = db.define("group", {
		name: { type: "text", required: true },
		general_chat: { type: "text", required: true, unique: true },
		admin_chat: { type: "t
KaneLeung
KaneLeung commented Oct 25, 2019

TIM截图20191025180951

DB.Updateable<t_stock_document>().SetColumns(k => new t_stock_document() { OutQTY = k.OutQTY - delDoc.F_Qty ?? 0, OutFinish = false }).Where(k => k.F_ID == delDoc.RelateID).ToSql();

语句中,使用??生成的Sql语句如图,运行时会报错 ,我以为是运算符优先级问题,
再加了括号试试,同样会报错,是否不支持??运算符
![TIM截图

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
prisma

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.