Category "typeorm"

How can I select `array_agg` in `typeorm` with `postgresql`?

I am using typeorm in typescript project to connect to postresql 11. I have below query in sql which gives me expected results: select "customerUuid", array_agg

TypeORM bulk insert?

How do i bulk insert multiple records in 1 query so my db will be efficient I want to create Office and insert multiple new equipments into that office. Table/m

"Cannot use import statement outside a module" in typeorm migration when run nestjs app

I have created the nestjs app. In the root app folder I have these subfolders: dist migration src test The migration folder contains typeorm migrations. When r

TypeORM migrations no changes were found

I'm trying to generate migrations with TypeOrm. When I change an entity, it should detect this change and generate a new migration. I get the following error

Revert a specific migration in TypeORM

Is it possible to revert a specific migration in Typeorm?, I want to only revert a particular migration and not all till I get to the migration I want to revert

Postgres OVERLAPS date function in TypeORM

I want to transfer the query to TypeORM. It looks like this in Postgres SELECT * from equipment_charging where (equipment_charging."start_date"::date, equipme

TypeORM column type dependant on database

I have simple entity @Entity() export class File { @PrimaryGeneratedColumn() id: number; @Column({type: "mediumblob"}) data: Buffer; } Which

TypeORM problem saving entity with cascade true

I m using NestJS with TypeORM and I m trying to save a user conversation with messages. I set the messages field on the conversation entity to cascade: true. Bu

Entity metadata for Role#users was not found

Trying to make OneToMany and ManyToOne relationship with TypeORM but I get this error, I don't know what's wrong with my code. I have the following User entity:

Updating Multiple Records with varying conditions in a single query

With Typeorm + NestJS + Postgres is there a way to update multiple records with varying conditions and varying values in a single query. Normally I could do awa

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 can I create a TypeORM Postgres connection with Heroku using Typegraphql?

I want to create a TypeORM Postgres connection with Heroku using Typegraphql, but I receiving the following error message: 'createConnection' is deprecated.ts(6

TypeError: Class extends value undefined is not a function or null

I am getting the following error when trying to create these entities. TypeError: Class extends value undefined is not a function or null I am assuming this h

Can't join FREETEXTTABLE with typeORM functions

I'm working on a graphQL backend with TypeORM I found FREETEXT, CONTAiNS, FREETEXTTABLE and CONTAINSTABLE options for fulltext searching in my SQL database. As

How to validate request in typeorm controller

I have created a sample application to save data for a user. I wanted to know how to validate it before saving and showing the response in JSON. I have got a re

Typeorm of sql query

This query works well on the database, however I'm not able to make it work by using typeorm createQueryBuilder. SELECT * FROM content INNER JOIN FreeTextTable

TypeORM AfterInsert() can't add userId in another table

I have a user entity: @Entity() export class User extends BaseEntity { @PrimaryGeneratedColumn('uuid') id: string; //... @OneToOne(() => UserActive

How to show generated SQL / raw SQL in TypeORM queryBuilder

I developed typeorm querybuilder. For the purpose of debugging, I'd like to show the generated SQL query. I tested printSql() method, but it didn't show any SQL

how can i specify the migrations directory for typeorm CLI

After the new typeorm release a have some troubles to work with migrations. Some time ago i was using that code and it work entities: ['./src/modules/**/infra/t

How can I have IS NULL condition in TypeORM find options?

In my queries I'm using TypeORM find option. How can I have IS NULL condition in the where clause?