Introduction to TypeORM QueryBuilder
The
QueryBuilder is a powerful TypeORM feature that allows developers to build SQL queries using an elegant syntax, execute them, and receive automatically transformed entities. It provides a type-safe way to construct complex queries without writing raw SQL.const firstUser = await dataSource
.getRepository(User)
.createQueryBuilder("user")
.where("user.id = :id", { id: 1 })
.getOne()