Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
13 views

How can i generate the arrow function format typeorm migration file?

when ever i am generating migration file i am getting this kind of format public async up(queryRunner: QueryRunner): Promise<void> { await queryRunner.query(`ALTER TABLE "transaction&...
Sriram Alavalapati's user avatar
1 vote
0 answers
19 views

Unable to Resolve Dependencies from EntityRepository in TypeOrmModule. But EntityRepository doesn't exists

I am working on a NestJS project that uses TypeORM. Currently implementing a data feed in the 'command handler' pattern so each user has a customized output from the same endpoint. Error Message - [...
cryxnet's user avatar
  • 155
-2 votes
0 answers
20 views

Trouble using Post method in nest js

I used dto to recieve data with object with post in nestjs typeorm @Post(':userId/charge-amount') @HttpCode(HttpStatus.OK) async chargeUser( @Body() chargeAmountDTO : ChargeAmountDTO, ...
김민겸's user avatar
0 votes
1 answer
18 views

How to run a specific migration file using typeorm in node.js?

I'm currently working on a Node.js project using TypeORM with PostgreSQL. I have multiple migration files, but I want to run only one specific migration file instead of all pending migrations. Below ...
Jaskaran's user avatar
0 votes
1 answer
29 views

How to select and enter all role names (separate column) in the incoming data field as an array in typeorm query

I have a typeorm library using nestjs and a mysql database which has a table user, user_roles (many to many) and roles. I also have a user who already has the super_admin role. const users = await ...
Dmitriy Novikov's user avatar
1 vote
1 answer
43 views

TypeOrm QueryBuilder add a new field if a relation was exist

this is my products entity: @Entity() export class Products { @PrimaryGeneratedColumn() id: number; @Column() name: string; @Column() code: string; @Column({ ...
alireza kargar's user avatar
0 votes
0 answers
28 views

Getting error as TypeError: typeorm_1.DataSource is not a constructor while exporting it from lib to other project

Getting error as TypeError: typeorm_1.DataSource is not a constructor when try to export from lib project and use in other project. Basically am upgrading Nodejs, Typeorm and Typescript to latest ...
Devsi Odedra's user avatar
  • 5,272
0 votes
0 answers
17 views

TypeORM - one-to-one relationship is null

First time using TypeORM, so i'm sorry if it's a very basic issue. I have two entities: user and params: @Entity() export class User { @PrimaryGeneratedColumn() id: number; @Column({ ...
Kaneda's user avatar
  • 132
0 votes
0 answers
16 views

Can not query users with at least one item of a given array in typeorm (querybuilder)

I have a user table on a Postgres db. A user can have multiple achievements where achievement are its own type T_ACHIEVEMENT_USER Now I want to write a simple query with typeorm where I get all users ...
zlZimon's user avatar
  • 2,538
0 votes
0 answers
42 views

How to write insert query using CTE from another table in typeorm query builder

I'm trying to create an SQL query using typeorm's query builder but facing some issue with CTE express which will be the input query for the UPSERT statement Below is the SQL query that I would like ...
Rohit Khatri's user avatar
  • 2,000
0 votes
0 answers
13 views

Getting issue with extends class when upgraded type orm from 0.2.20 to 0.3.20

I have an entity which is extending ValidateBaseEntity. import { Column, Entity, PrimaryGeneratedColumn } from "typeorm"; import { DateTransformer } from "../common/transformers"; ...
Aquif Zubair's user avatar
0 votes
0 answers
50 views

pg-mem with typeorm for in memory jest testing

i have a express app i am creating in typescript. I also am using typeorm as my orm for connecting to the database and actioning on it. I already have jest unit tests but i also wanted to create ...
Attiq Ahmed's user avatar
0 votes
1 answer
17 views

How to Mock TypeORM's Entity Manager Transaction for behavior assertion when Unit Testing in Jest?

Question I am trying to write a unit test for a method that uses TypeORM's entity manager transaction. The method is defined as follows: class MyRepository { private readonly repository: Repository&...
Sergio Yepes's user avatar
0 votes
1 answer
24 views

Node.JS Typescript TypeORM ManyToMany `save` overrides previous relation instead of adding a new one

I have the following typescript TypeORM model: @Entity() export class Student extends EntityBase { @Column({ length: 256 }) public firstName: string @Column({ length: 256 }) public ...
khteh's user avatar
  • 3,734
0 votes
2 answers
32 views

Node.JS Typescript TypeORM ManyToMany relations add a relation and update the entity

I have the following typescript TypeORM model: @Entity() export class Teacher extends EntityBase { @Column({ length: 256 }) public firstName: string @Column({ length: 256 }) public ...
khteh's user avatar
  • 3,734

15 30 50 per page
1
2 3 4 5
115