Skip to content

Statement.run() with object parameter panics #114

Open
@penberg

Description

@penberg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions