Skip to content

Commit

Permalink
Merge pull request #351 from penberg/improve-named-param-tests
Browse files Browse the repository at this point in the history
libsql/core: Improve named parameter tests
  • Loading branch information
penberg authored Sep 4, 2023
2 parents 494b5db + 8cf6969 commit 5e67cb4
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 5e67cb4

Please sign in to comment.