Category "typeorm"

TypeORM SUM Operator on Relation's field

I am a student trying to develop a music library just to try out new technologies. Currently I use NestJS together with TypeORM as my backend technologies (as w

Typeorm createQueryBuilder.innnerJoinSelect() not returning the columns of a table

I'm attempting to select columns of two tables tradie,postcode_distance using innerJoinAndSelect but unfortunately, I'm not fetching those columns. Here's what

TypeORM Entity in NESTJS - Cannot use import statement outside a module

Started new project with 'nest new' command. Works fine until I add entity file to it. Got following error: import { Entity, Column, PrimaryGeneratedColumn

Update a table with its relations in TypeOrm

We have: Postgres Database Photo: import {Entity, PrimaryGeneratedColumn, Column, ManyToOne} from "typeorm"; import {User} from "./User"; @Entity() export clas

Dynamic database connection/initialization in typeorm `0.3.6` with Express

typeorm 0.3.6 deprecated createConnections() and and introduced DataSource. It is causing some issues with multi-tenant architecture. Either I have to initializ

How to transfer a filter to a query (TypeORM)

I want to get rid of the filter and put it in the request body. I tried using where, how can I do it? Questionnaire entity like: @OneToMany(() => LikeEntity,

How to save line breaks in database

I'm using typeorm to management my databse with nestjs framework on server and vuejs on client side, in settings i must provide a large text and i must to save

How to fix: No changes in database schema were found - cannot generate a migration?

I searched a lot and there are several questions like this however most of them do not have any answer or are not relevant to me. I'm using TypeORM(v0.2.45) wit

Typeorm How Can I get Min field with Where clause?

I use Typeorm and nestjs in my project. I have Schema: export class GroupEntity implements IGroup { // Attributes @PrimaryGeneratedColumn({ type: 'string' }

Expo TypeORM EntityMetadataNotFoundError

I'm trying to use typeorm on an expo project through driver expo-sqlite but I've been stuck on to this metadata EntityMetadataNotFoundError: No metadata for "Us

TypeORM Insert Cascade no effect

I Have a parent entity CostCenter that contains an Array of Coordinators, coordinators: Array<Coordinator> and this attribute has the typeORM annotations

The proper way to achieve database locks (Pessimistic Read and Write) with TypeORM and NodeJS

I have an application that needs to deal with concurrency/race conditions. I noticed user account balances were being updated wrongly. Multiple requests can rea

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

GraphQLError: Query root type must be provided

I'm using NestJS, TypeORM and GraphQL for my backend API. I'm getting the following error: GraphQLError [Object]: Query root type must be provided. at Sch

TypeORM + FoalTS Multiple Database Connections

For some context, I'm building an NodeJS app with FoalTS which uses Express and TypeORM underneath. My question is around how to implement multiple database con

Nestjs create Generic CRUD service

I want to create a base service using a generic class which I wrote below: import { BaseEntity } from './base.entity'; import { Repository } from 'typeorm'; e

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