libsql-js icon indicating copy to clipboard operation
libsql-js copied to clipboard

Statement.run() with object parameter panics

Open penberg opened this issue 9 months ago • 0 comments

The following additional test case that calls Statement.run() with an object (not array) parameter:

diff --git a/integration-tests/tests/sync.test.js b/integration-tests/tests/sync.test.js
index 06d96b8..327010a 100644
--- a/integration-tests/tests/sync.test.js
+++ b/integration-tests/tests/sync.test.js
@@ -48,6 +48,9 @@ test.serial("Statement.run() [positional]", async (t) => {
   const info = stmt.run(["Carol", "[email protected]"]);
   t.is(info.changes, 1);
   t.is(info.lastInsertRowid, 3);
+  const info2 = stmt.run("Dave", "[email protected]");
+  t.is(info2.changes, 1);
+  t.is(info2.lastInsertRowid, 4);
 });

Panics:

thread '<unnamed>' panicked at src/statement.rs:345:62:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
sh: line 1: 96349 Abort trap: 6           LIBSQL_JS_DEV=1 PROVIDER=libsql ava tests/sync.test.js

penberg avatar May 23 '24 06:05 penberg