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,841
questions
-2
votes
0
answers
8
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
17
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
7
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
17
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
25
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
21
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
15
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
41
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
14
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
22
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>;
...
0
votes
1
answer
16
views
Issue while returning array of objects from graphQL query response
hey I'm using graphQL with NestJS and Apollo Server.
The issue is I can return one object but while returing array of objects it's throwing error.
Please find the response I want to return:
{
...
0
votes
0
answers
14
views
Can't run TypeOrm migrations with webpack: MODULE_NOT_FOUND
I have node.js app built with webpack. I am following this FAQ
My webpack config has one entrypoint for the migrator script, and multiple entrypoints for migration files:
const commonConfig = require('...
0
votes
1
answer
46
views
How to correctly create the connection to a local SQL Server database using TypeORM for Langchain?
I am trying to connect to my local SQL Server database to use it with Langchain. This is how I am trying to create the connection but keep getting the error shown below when fromDataSourceParams runs:
...
0
votes
0
answers
22
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 ...
0
votes
0
answers
25
views
Where not in query error invalid input syntax for type bigint typeorm
I was working on a project and i need to use "where not in" query like this
return manager
.getRepository(SlideshowItemEntity)
.createQueryBuilder('slideshow_items')
.softDelete()
....