4 ms·
I thought the same. It's not true with TypeORM in Nest either. If you're using DI it's basically impossible in Nest. constructor( // this is the on
by itslennysfault 3y ago
I thought the same. It's not true with TypeORM in Nest either. If you're using DI it's basically impossible in Nest.
constructor(
// this is the only way to get a repository for the photo table/model
private photoRepository: Repository<Photo>,
) { }
getPhoto() {
// this would be type Photo
const photo = this.photoRepository.findOne();
}
- beart 3y agoYou can inject a TypeORM data source which is non typed and create a query builder, but as pointed out, it's opt in.