Most voted "typeorm" questions
31 questions
Sort by count of
-
5
votes1
answer109
viewsDoubt about generic types in Typescript
I am currently studying Typeorm, and wanted to create a generic controller, as it will always be the same CRUD operations. I know I can solve with native Typeorm solutions, such as getRepository(),…
-
2
votes0
answers377
viewsHow to run Typeorm Migrations on Heroku?
By putting my code into production at Heroku, Migrations database are not running. How could I run them once I start my application? Postgresql is the database used. Archive of database…
-
2
votes1
answer363
viewsTypeorm query with Inner Join is coming empty
I made two tables, Usuario 1 : N Produto I made an Inner Join with Typeorm, but an empty array was coming, so I took the query it was generating to analyze it better. When I played the query in…
-
2
votes0
answers152
viewsOnetomany / Manytoone Typeorm relationship is not saving the foreign key. The value goes as NULL
Well, I’m using Typeorm in my TCC project. It’s something very simple, nothing very complex. I am using Postgresql to save the data, in the database I have only two tables, a call users and another…
-
1
votes1
answer589
viewsEntity mapping Many to Many with typeorm
What I want to do is a list of all the objects that are related by the ID to an entity. In this project, a group has several users and one user belongs to several groups. Group entity:…
-
1
votes0
answers62
viewsRepository.findAndCount in related table column in typeorm/graphql
I am using typeorm and graphql in my api and want to make a findAndCount in a table called corresponding_users that has a one to one relation with the table users, but the query only works if Where…
-
1
votes1
answer582
viewsMigration does not create table in database. Typeorm, postgresql
Good evening, you guys. In this project I am using typeorm to configure my database. I create my Migration, but when I execute the command Yarn typeorm Migration:run, It doesn’t create the table I…
-
1
votes1
answer587
viewsRelationship Manytoone / Onetomany Typeorm does not save foreign key
Hello, I am developing an Node API using Typeorm and Sqlite3, but when using the Manytoone/Onetomany relationship, it does not save the foreign key. The scenario is as follows: I have a user who can…
-
1
votes0
answers28
viewsProblem with Primary Key ambiente_id instead of id in Typeorm
I am trying to create a table in the Mysql database, with Typeorm where the id is ambiente_id (nome da tabela + _ + id). Error: ER_WRONG_AUTO_KEY: Incorrect table Definition; there can be only one…
-
1
votes0
answers43
viewsProblem with findOne verification
I am using typeorm and postgres. In my use case I have a execute method: async execute({ name, email, password }: ICreateUserDTO): Promise<void> { const userExists = await…
-
1
votes0
answers48
viewsSQL Join with typeorm
Look at this, I have the following structure of entities: Entity/Ticket.ts import {Entity, PrimaryColumn, Column, OneToMany, ManyToOne, OneToOne, JoinColumn} from "typeorm"; import { Academia } from…
-
0
votes2
answers860
viewsNestjs with Typeorm for Mysql - Nodejs
I’m starting in the area so sorry if it’s something silly. I started developing a server using Nestjs with Typeorm to connect to a Mysql database but am picking up the following error: 'No…
-
0
votes0
answers46
viewsconvert sql to typeorm
I’m trying to convert this code sql for typeorm, thanks no more. select * from Product join Category on Category.id = Product.category_id where(Category.title = "Celular");…
-
0
votes0
answers15
viewsError while using Raw from typeorm postgres
all right? I am having a problem in my application, I am using postgres with typeorm and when I try to use the find method with a Raw on Where, it presents the following error: "error": "column…
-
0
votes1
answer187
views400 Bad request on express and typeorm server
Hello, I’m trying to create a user, but when sending the post method with the user data I get one 400 Bad Request server, the problem is that the server is not understanding the data, in the error…
-
0
votes1
answer249
viewsUpdate user photo data with nodejs and Typeorm
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from 'typeorm'; import Doctor from './Doctor'; import Patient from './Patient'; @Entity('images') export default class Image…
-
0
votes0
answers63
viewsSum all records from two different tables
I have two different tables: Entrances and Exits. Each table has columns motive and value I am using Typescript and Typeorm, and the Controller to list both is as follows: class SaidaController {…
-
0
votes1
answer66
viewsHow to make an Insert in the database from a many to many relationship in typeorm
I am developing a professional register where each professional can speak one or more languages, however when saving professionals, languages are not saved @Entity('idioma') export class Idioma {…
-
0
votes1
answer91
viewsExpress runs but does not work. JS Node
Good afternoon everyone, I’m having a little problem with the server express in a Node JS application with typescript, typeorm and postgres SQL where when executing the command npm run dev the…
-
0
votes1
answer310
viewsMigrations of Manytomany relations on Typeorm using Queryrunner
It is possible to create the SQL of an Migration automatically, through the CLI command migration:generate -n MigrationName? However, it is possible to create Migrations from Migration API, more…
-
0
votes0
answers41
viewsWhat is the best way to perform a dependent insertion of another entry into the database using Typeorm?
The entities involved are the following (cardinality Onetoone) User import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from "typeorm"; import Profile from "./Profile"; @Entity()…
-
0
votes0
answers74
viewsWhy is the typeorm find method returning me a string instead of an array?
I have a tool modem as it lies below: import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, OneToMany, } from 'typeorm'; import OrdersTools from './OrdersTools';…
-
0
votes0
answers40
viewsType Orm Relations between entities does not bring the data
My question is how the typeorm brings data from your relationships. const user = await this.userRepository.findOne({ where: { id }, relations: ['userAddress', 'emails', 'phone_numbers', 'person',…
-
0
votes0
answers26
viewsUpdate error in relation @Manytoone with Typeorm
Good afternoon, in my application I have the relation that an Order can have several Deliveryrequests. But when I do a save(order) it is updated correctly but an SQL settando is generated as NULL…
-
0
votes0
answers17
viewsTypeorm filter columns that have been transformed
I used the typeorm-Encrypted, to encrypt columns containing sensitive application data via the parameter Transformer as shown below: @PrimaryColumn() protocolo: number; @Column({ nullable: false,…
-
0
votes0
answers9
viewsI have a MYSQL and TYPEORM database like Orm, when I start the server, 2 FK columns are added in a table
When I start the server, typeorm logs these changes: query: ALTER TABLE `topresente`.`classes` DROP COLUMN `class_id` query: ALTER TABLE `topresente`.`classes` DROP COLUMN `subject_id` query: ALTER…
-
0
votes0
answers10
viewsNot operator does not work on typeorm
I am using typeorm in my Ode app and mongodb database. I have only one collection called "users" and have a route to get all users except me. So, here’s my code: const foundUsers = await…
-
-1
votes1
answer263
viewsInheritance with Typeorm
There are common problems that I see a lot of difficulty to deal with Orms, and ignoring a native way I decided to ask what is the best way to deal with these using Typeorm in project. Today I have…
-
-1
votes1
answer78
viewsRun script compiled using typescript + Babel + typeorm
While trying to execute node .\dist\index.js compiled using Babel have the following error: In dev runs without errors, all tests also pass, consuming the API also everything normal, but when I…
-
-2
votes0
answers7
viewsHow can I convert QUERY to TYPEORM functions
TABLE subjects id, course_id, Subject, subject_name, created_at TABLE Ourses id, source, name, info, created_at I have this function that searches the following fields .query(`SELECT subjects.id,…
-
-2
votes1
answer98
viewsAdd database data from an Array in Nodejs using typescript
I am developing an Application in Nodejs that has the following entity: import User from '@modules/users/infra/typeorm/entities/User'; import { Entity, Column, PrimaryGeneratedColumn,…