mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 09:04:19 +01:00
serverless: Add Statement.run() method
This commit is contained in:
@@ -45,6 +45,12 @@ test.serial('prepare() method creates statement', async t => {
|
||||
t.is(rows[0][1], 'John Doe');
|
||||
});
|
||||
|
||||
test.serial('Statement.run()', async t => {
|
||||
const stmt = client.prepare('INSERT INTO test_users (name, email) VALUES (?, ?)');
|
||||
const row = await stmt.run(['Jane Doe', 'jane@example.com']);
|
||||
t.is(row.lastInsertRowid, 2);
|
||||
});
|
||||
|
||||
test.serial('statement iterate() method works', async t => {
|
||||
// Ensure test data exists
|
||||
await client.execute('CREATE TABLE IF NOT EXISTS test_users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)');
|
||||
|
||||
Reference in New Issue
Block a user