Category "orm"

How to use regex or any other operator with whereIn clause

Is there any way we can use operator or regex as we normally do with the whereIn() clause. I want to use something like this $query->whereIN(name,'like','%te

Sequelize js how to get average (aggregate) of associated model

I am trying to get average rating of an associated Model "Rating" of Model "User" using sequelize. sequelize.sync({logging: false}).then(()=>{ return Mode

Advise on orm modelling in django

I am building a webapp in which users place orders with nested information. I am after some advice on best practice so I can do some more research. The idea is

Orm or RAW sql which one is better?

I have a question about Orm or RAW sql Can you tell me which one I should choose if I want to create a large-scale project? And why?

Typeorm. use only the date part while querying via date and exclude the timestamp part

I have a use case where I have to retrieve a users record from the database via his date of birth. The thing is that we have stored the date of birth of the use

Node Js sequelize select query by month

Am new in Node Js, In my Node Js project am using sequelize ORM with MySql database. This is my query i want to write select query by month. This is my query

.NET Core Entity Framework how to map nested class into one sql table

I'm still new to .NET Core. I have this character that I want to store in SQLite using an entity. But by default, Character, CharacterData and CharacterLine are

SilverStripe unable to populate multiple member Childs

I have 3 type of users salesman => has many buyers buyer => has many agents agent has none child so I want to list all the buyers associate with that sale

SQLAlchemy: What is the best way to validate a model before inserting or updating

I'm trying to validate a SQLAlchemy model before it is inserted or updated, e.g class MyModel(db.Model): foo = db.Column(db.String(255)) bar = db.Colum

How to consolidate TypeORM migrations

At the moment I'm not a guru on TypeORM and have made a few mistakes with my migrations - with our non-production database now in a state where I'd like it, is

Many-to-many relationship with parent with two releationships to same child

I'm trying to model a simple (at least I thought so) relationship like in a recipe (I'm using flask-sqlalchemy): I have a Recipe, that has input materials and o

How to build query from SQL by Doctrine QueryBuilder?

I'm new in Doctrine ORM, and I need help with building QueryBuilder command. I have a SQL command and I need covert to QueryBuilder. $qb = $this->entityManag

Error executing DDL "drop table Player if exists" via JDBC Statement

Creating a spring mvc project with database using java configuration . The application gives error for tables operation like create, drop, alter operation for

Room field / getter mismatch warning when using sealed classes or Any

I have a Room (v2.4.0-beta01) database, and whilst it works fine, during the build it gives a field vs getter mismatch warning on a few fields, included below.

Hibernate 6: What is SQM?

In the Hibernate 6.0 Roadmap (https://github.com/hibernate/hibernate-orm/wiki/Roadmap6.0) SQM is mentioned as upcoming. What is SQM? In this roadmap the follo

Sequelize ARRAY Datatype for PostgreSQL

I'm trying to use the ARRAY datatype for Sequelize (Node.js SQL ORM) with PostgreSQL. However I'm not exactly sure how to utilize it. I know how to set it on th

How to give a unique constraint in lucid model, I am using lucid in adonis with typescript

In adonis.js i am trying to add a unique constraint to email field just like we do it in sequelize,prismajs or any other orm.Is it posible to add in adonis.

Does TypeORM supports raw SQL queries for input and output?

I would like to know if there is a feature of TypeORM that supports raw sql queries for Insert Update Delete Select etc..

How to remove default value in model and add alembic version?

I am having a pyramid application which uses sqlalchemy and alembic for databases and migrations. I need to remove default specifier from my model class and add

How to Make Laravel Eloquent "IN" Query?

I want to make query in Laravel Eloquent like here its raw MySQL query SELECT * from exampleTbl where id in(1,2,3,4) I have tried this in Laravel Eloquent