Category "typeorm"

Is there a way to use configService in App.Module.ts?

I am building RESTful service with NestJs, I have followed the example to build configurations for different environments. It works well for most code. However

How to query for manyTomany relation in typeorm?

I m trying to fetch user details using typeorm in nestjs below are the tables in mysql database user table id (PK) email 1 [email protected] 2 [email protected] role table

Pagination and filtering in TypeScript and TypeORM

How can i create an function to pagination and filtering with typeorm? I use queryBuilder() but i don't how to create an function to divide the results into pag

Select specific columns from jeft join query, TypeORM

I have a task to get key information about users in database. There are many left joins and the query works quite slow. I'm trying to optimize it somehow and I

Error while call prostresql procedure nestjs/typeorm

I have this stored procedure to save a purchase with a token relate. But I'm facing an error when I try to call it in Nestjs/typeorm. I checked and I'm passing

TypeORM CLI: No changes in database schema were found

I'm am developing an application using NestJS and TypeORM. Whenever I try to generate migrations from my entities (by running typeorm migration:generate) I get

TypeORM OneToMany causes "ReferenceError: Cannot access '<Entity>' before initialization"

I have two entities: User and Habit. A user can create multiple Habits, thus I use a OneToMany relation on the User (and ManyToOne on the Habit, respectively).

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

How to save a nested object using typeorm and Nestjs?

I have the following Data entity: @PrimaryGeneratedColumn() id: number @Column() dataA: string @Column() dataB: string @Column() dataC: number @Colum

TypeORM: how to load relations with CreateQueryBuilder, without using JOINs?

I'm developing an API using NestJS & TypeORM to fetch data from a MySQL DB. Currently I'm trying to get all the instances of an entity (HearingTonalTestPage

How can I get my User entity in UserApi to get connectin to db?

I have an apollo-express-server with redis cache. This is the index.ts: const main = async () => { const app = express(); app.use( cors({ cre

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: