Skip to content

Commit

Permalink
libsql/core: Improve named parameter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
penberg committed Sep 4, 2023
1 parent 494b5db commit 8cf6969
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions crates/core/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,44 @@ fn prepare_and_query_named_params() {
":b": "Alice",
},
);

check_insert(
&conn,
"INSERT INTO users (id, name) VALUES (@a, @b)",
vec![
("@a".to_string(), 2.into()),
("@b".to_string(), "Alice".into()),
]
.into(),
);

check_insert(
&conn,
"INSERT INTO users (id, name) VALUES (@a, @b)",
named_params! {
"@a": 2,
"@b": "Alice",
},
);

check_insert(
&conn,
"INSERT INTO users (id, name) VALUES ($a, $b)",
vec![
("$a".to_string(), 2.into()),
("$b".to_string(), "Alice".into()),
]
.into(),
);

check_insert(
&conn,
"INSERT INTO users (id, name) VALUES ($a, $b)",
named_params! {
"$a": 2,
"$b": "Alice",
},
);
}

#[test]
Expand Down

0 comments on commit 8cf6969

Please sign in to comment.