Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
inoas committed Jul 15, 2024
1 parent 4f6e9fd commit 0b50429
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# erlang 26.2.5.1
erlang 27.0
erlang 27.0.1
# gleam 1.3.2
gleam nightly
4 changes: 2 additions & 2 deletions src/cake.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub fn read_query_to_prepared_statement(
dialect dlct: Dialect,
) -> PreparedStatement {
dlct
|> dialect.placeholder_base()
|> dialect.placeholder_base
|> read_query.to_prepared_statement(query: qry, dialect: dlct)
}

Expand All @@ -87,7 +87,7 @@ pub fn write_query_to_prepared_statement(
dialect dlct: Dialect,
) -> PreparedStatement {
dlct
|> dialect.placeholder_base()
|> dialect.placeholder_base
|> write_query.to_prepared_statement(query: qry, dialect: dlct)
}

Expand Down
6 changes: 3 additions & 3 deletions src/cake/internal/read_query.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ pub fn combined_clause_apply(
// ```

let open_nested_query = fn(prp_stm: PreparedStatement) -> PreparedStatement {
case prp_stm |> prepared_statement.get_dialect() {
case prp_stm |> prepared_statement.get_dialect {
Sqlite -> prp_stm |> prepared_statement.append_sql("SELECT * FROM (")
_ -> prp_stm |> prepared_statement.append_sql("(")
}
}

let close_nested_query = fn(prp_stm: PreparedStatement, nested_index: Int) -> PreparedStatement {
case prp_stm |> prepared_statement.get_dialect() {
case prp_stm |> prepared_statement.get_dialect {
Sqlite ->
prp_stm
|> prepared_statement.append_sql(
Expand Down Expand Up @@ -787,7 +787,7 @@ fn where_xor_apply(
prepared_statement prp_stm: PreparedStatement,
where whs: List(Where),
) -> PreparedStatement {
case prp_stm |> prepared_statement.get_dialect() {
case prp_stm |> prepared_statement.get_dialect {
Postgres | Sqlite -> custom_where_xor_apply(prp_stm, whs)
Maria | Mysql -> vanilla_where_xor_apply(prp_stm, whs)
}
Expand Down
4 changes: 2 additions & 2 deletions test/cake_test/delete_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ pub fn delete_execution_result_test() {
delete_sqlite() |> d.to_query |> sqlite_test_helper.setup_and_run_write
let mdb_exec =
delete_maria_mysql()
|> d.to_query()
|> d.to_query
|> maria_test_helper.setup_and_run_write
let mdb_cnt =
delete_affected_row_count_maria_mysql_query()
|> maria_test_helper.setup_and_run
let myq_exec =
delete_maria_mysql()
|> d.to_query()
|> d.to_query
|> mysql_test_helper.setup_and_run_write
let myq_cnt =
delete_affected_row_count_maria_mysql_query()
Expand Down
2 changes: 1 addition & 1 deletion test/cake_test/update_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import test_support/adapter/sqlite
fn swap_is_wild_sub_query() {
let swap_bool_exp_sql =
"(CASE WHEN is_Wild IS true THEN false ELSE true END) AS swapped_is_wild"
|> string.trim()
|> string.trim

s.new()
|> s.from_table("cats")
Expand Down

0 comments on commit 0b50429

Please sign in to comment.