Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Statement.run() with object parameter panics #114

Open
penberg opened this issue May 23, 2024 · 0 comments
Open

Statement.run() with object parameter panics #114

penberg opened this issue May 23, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@penberg
Copy link
Contributor

penberg commented May 23, 2024

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", "carol@example.net"]);
   t.is(info.changes, 1);
   t.is(info.lastInsertRowid, 3);
+  const info2 = stmt.run("Dave", "dave@example.org");
+  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 penberg added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels May 23, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant