Questions tagged [typeorm]
TypeORM is an object-relational mapper for TypeScript and JavaScript that supports many different databases like MySQL and PostgreSQL and platforms like Node.js and the browser.
typeorm
4,836
questions
1
vote
0
answers
13
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
- [...
0
votes
0
answers
7
views
Using TypeORM in Nuxt 3
I am trying tu use TypeORM in a Nuxt 3 application.
[email protected]
[email protected]
I added TypeORM as a plugin:
// plugins/typeorm.ts
import 'reflect-metadata';
import { defineNuxtPlugin } from '#app';
...
0
votes
0
answers
10
views
Typeorm PostgreSQL schema acts like not existing even it exists
I have a database in postgres with different schemas. I want to use schema named g which contains my tables, see:
This is what app module looks like:
...
TypeOrmModule.forRootAsync({
imports : [...
0
votes
0
answers
12
views
Typeorm Subscibrers UpdateEvent
async afterUpdate(event: UpdateEvent<Experience>) {
const old_pub = event.databaseEntity;
const new_pub = event.entity as Experience;
const statusJustChanged = old_pub.status != ...
0
votes
0
answers
21
views
ER_NOT_SUPPORTED_AUTH_MODE Error even though mysql2 is being used [duplicate]
I am receiving an error
ERROR [ExceptionHandler] ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
every time I try to ...
-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,
...
0
votes
1
answer
28
views
Why don't I automatically write time information to @CreateDateColumn?
this's my datebase column info;
`create_time` datetime DEFAULT NULL COMMENT 'Create Time',
`update_time` datetime DEFAULT NULL COMMENT 'Update Time',
and this's my entity
@CreateDateColumn({ type: ...
0
votes
0
answers
9
views
NestJS: Why does custom DB-logger (implementing TypeOrmLogger) only show DB-requests in log, not DB-responses
In my NestJS service, I've implemented a custom DB logger, which is meant to log both the before (requests), as well as the after (DB responses) info. I've done this by implementing the suggested ...
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 ...
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 ...
0
votes
0
answers
23
views
TypeORM fails to load postgresql tables associated with the id in Nest.js application
The problem I'm facing is that this query sometimes returns jobs where userId is not present in reviewUsers, inviteUsers, or favouriteUsers, despite expecting to retrieve all jobs where userId matches ...
0
votes
0
answers
18
views
How to use a custom DB logger with TypeORM?
I am using TypeORM and NestJS. The default TypeORM logger seems to not log in JSON output format, which is what I want.
How can I create a custom DB logger that allows me to customise how I want to ...
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({
...
0
votes
0
answers
16
views
No metadata for "User" was found using TypeORM, ExpressJS, Supertest and Testcontainers
I am trying to write integration tests for an expressjs application which uses TypeORM and a PostgreSQL database. The main application works fine without any issues with a main datasource, migrations ...
0
votes
1
answer
25
views
How to dynamically inject a repository in Nestjs
I want to create a service that receives an entity and creates a repository.
This is my attempt:
export class MyService<T extends ObjectLiteral> {
protected repo: Repository<T>;
...