Skip to content

Commit

Permalink
fix union order by limit offset
Browse files Browse the repository at this point in the history
  • Loading branch information
inoas committed Apr 30, 2024
1 parent 6ce40be commit f0f1af5
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 116 deletions.
8 changes: 3 additions & 5 deletions src/cake.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ pub fn run_dummy_union_all() {
"age",
param.IntParam(7),
))

// UNION must take ORDER BY at the outside
// it can also take an own LIMIT and OFFSET
// |> query.select_query_order_asc("name")
|> query.select_query_order_asc(by: "will_be_removed")

let union_query =
query.combined_union_all_query_new([select_query_a, select_query_b])
// |> query.union_set_limit(1)
|> query.combined_query_set_limit(1)
|> query.combined_query_order_replace(by: "age", direction: query.Asc)
|> query.query_combined_wrap
|> iox.dbg

Expand Down
Loading

0 comments on commit f0f1af5

Please sign in to comment.