Skip to content

Schema name is ignored when building SQL Query (PostgreSQL) #198

Answered by billy1624
frankhorv asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @frankhorv, welcome!!

Can you try...

let query = Query::select()
  // Use `.table_ref()` here
  .from(Table1.table_ref())
  .left_join(
      // And here
      Table2.table_ref(),
      Expr::tbl(Table1, Table1Column::ReferenceId)
          .equals(Table2, Table2Column::Id),
  )
  .and_where(Expr::col(Table1Column::AnotherId).eq(another_id))
  .to_owned();

The table_ref() defined in EntityName trait

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by billy1624
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #196 on December 01, 2021 10:05.