Skip to content
New issue

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

find_with_related panic #374

Closed
MorganNesbitt opened this issue Dec 10, 2021 · 2 comments · Fixed by #376
Closed

find_with_related panic #374

MorganNesbitt opened this issue Dec 10, 2021 · 2 comments · Fixed by #376
Assignees

Comments

@MorganNesbitt
Copy link

Hey, I am new to sea-orm, so was looking to see if I could get some help around this.

I have two entities with a one to many relation (that I built using the cli generation).
I can fetch them both individually, but it panics when I try to join them together.

They are quite big structs, each with the following properties

  • id is a uuid
  • have one Postgres enum
  • with the only overlapping fields being id and their respective createdAt and updatedAt.
  • foreign key is on the relevant uuid of the other table.
  • fields are camelCase

I'm using the column_name attribute to map from snake case in the struct to camel case in the db.

here is a variant of the query in question, but just building the query

    let query = CustomerEmployeeRecord::find()
        .find_with_related(HistoricalCustomerEmployeeRecord)
        .build(DbBackend::Postgres)
        .to_string();

Result:

thread 'main' panicked at 'cannot apply alias for expr other than Column'

any help we be greatly appreciated!

@MorganNesbitt MorganNesbitt changed the title Find with related panic find_with_related panic Dec 10, 2021
@billy1624
Copy link
Member

Hey @MorganNesbitt, welcome! And thanks for the report. I'm digging into it right now

@tyt2y3
Copy link
Member

tyt2y3 commented Dec 12, 2021

0.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants