We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When trying to orderBy a column of an embedded entity the query fails while using take/skip and joining another.
const result = await postRepo.createQueryBuilder("post") .leftJoinAndSelect("post.user", "user") .orderBy("post.blog.date") .take(2) .skip(1) .getMany();
It should be possible to sort by properties in embedded entities.
Error Message:
TypeError: Cannot read property 'databaseName' of undefined at /home/h4kor/code/ajai/typeorm/src/query-builder/SelectQueryBuilder.ts:2013:145
I will provide an Pull Request shortly.
Use the query above and executed with the entities below.
Entities:
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "../../../src"; @Entity() export class User { @PrimaryGeneratedColumn() id: number; @Column() name: string; @OneToMany( () => Post, (post) => post.user, ) posts: Post[]; } export class PublishInfo { @Column({ nullable: true }) date: Date; } @Entity() export class Post { @PrimaryGeneratedColumn() id: number; @Column() text: string; @Column(_type => PublishInfo) blog: PublishInfo; @Column(_type => PublishInfo) newsletter: PublishInfo; @ManyToOne( () => User, (user) => user.posts, ) user: User }
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
The text was updated successfully, but these errors were encountered:
fix: Error when sorting by an embedded entity while using join and sk…
cfe58ec
…ip/take Closes: typeorm#7079
d27dd2a
…ip/take (#7082) Closes: #7079
Successfully merging a pull request may close this issue.
Issue Description
When trying to orderBy a column of an embedded entity the query fails while using take/skip and joining another.
Expected Behavior
It should be possible to sort by properties in embedded entities.
Actual Behavior
Error Message:
Steps to Reproduce
I will provide an Pull Request shortly.
Use the query above and executed with the entities below.
Entities:
My Environment
Additional Context
Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: