Skip to content

Commit

Permalink
Merge pull request #158 from tursodatabase/named-params
Browse files Browse the repository at this point in the history
add test for named params
  • Loading branch information
penberg authored Dec 30, 2024
2 parents 1386568 + 1cba7dd commit b7a6c9f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions integration-tests/tests/sync.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ test.serial("Statement.run() [positional]", async (t) => {
t.is(info.lastInsertRowid, 3);
});

test.serial("Statement.run() [named]", async (t) => {
const db = t.context.db;

const stmt = db.prepare("INSERT INTO users(name, email) VALUES (@name, @email);");
const info = stmt.run({"name": "Carol", "email": "[email protected]"});
t.is(info.changes, 1);
t.is(info.lastInsertRowid, 3);
});

test.serial("Statement.get() [no parameters]", async (t) => {
const db = t.context.db;

Expand Down

0 comments on commit b7a6c9f

Please sign in to comment.