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

Empty result when query with `kysely` + `libsql` at version 0.6.0-pre.9

Open osddeitf opened this issue 5 months ago • 2 comments

I have a setup of kysely + better-sqlite3. But it wasn't working with Deno, so I swtich to this library. It worked at first, until...

I needed to patch it:

diff --git a/node_modules/libsql/wrapper.js b/node_modules/libsql/wrapper.js
index 732b19f..a0da2b1 100644
--- a/node_modules/libsql/wrapper.js
+++ b/node_modules/libsql/wrapper.js
@@ -255,6 +255,7 @@ class Statement {
   }
 
   get reader() {
+    return null
     throw new Error("not implemented");
   }

I did some batch inserts and it worked just fine but when I query, it just returns empty:

const rows = await db.selectFrom("lookup")
    .selectAll()
    .executeTakeFirstOrThrow()

I checked and made extra sure the table had data.

I changed the version from 0.6.0-pre.9 to 0.5.13 and it worked without the patch above.

osddeitf avatar Jul 06 '25 06:07 osddeitf

Anyway, this might be related #177.

osddeitf avatar Jul 06 '25 06:07 osddeitf

Hi, I successfully used kysely-sqlite dialect with [email protected] but had to migrate to [email protected] because napi-rs works better with bun compiler. But it somehow stopped passing tests (I'm not sure if there is an intended difference in API between 2 versions or something other)

roll avatar Oct 29 '25 20:10 roll