Skip to content

Commit 8eaf8f1

Browse files
committed
add .query/3 test
1 parent 19bc195 commit 8eaf8f1

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- added: Added named params support
6+
57
## v0.31.0
68

79
- changed: Update sqlite to `3.50.0`.

test/exqlite/query_test.exs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ defmodule Exqlite.QueryTest do
3131
assert Enum.to_list(columns["y"]) == ["a", "b", "c"]
3232
end
3333

34+
test "named params", %{conn: conn} do
35+
assert Exqlite.query!(conn, "select :a, @b, $c", %{":a" => 1, "@b" => 2, "$c" => 3}) ==
36+
%Exqlite.Result{
37+
command: :execute,
38+
columns: [":a", "@b", "$c"],
39+
rows: [[1, 2, 3]],
40+
num_rows: 1
41+
}
42+
end
43+
3444
defp create_conn!(_) do
3545
opts = [database: "#{Temp.path!()}.db"]
3646

0 commit comments

Comments
 (0)