You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the FTS5 extension with libsql, but the Typescript client is failing to insert anything into the table. Here is my code:
import{createClient}from"@libsql/client";constclient=createClient({url: Bun.env.TURSO_LOCAL_FILEasstring,syncUrl: Bun.env.TURSO_DATABASE_URLasstring,authToken: Bun.env.TURSO_AUTH_TOKENasstring,});constcontents=awaitBun.file("./public/data.txt",).text();constchunks=contents.split("\n");awaitclient.execute(`DROP TABLE IF EXISTS docs;`);awaitclient.execute(`CREATE VIRTUAL TABLE IF NOT EXISTS docs USING fts5 (chunk);`,);letstms=[];for(leti=0;i<chunks.length;i++){stms.push({sql: ` INSERT INTO docs VALUES (:chunk); `,args: {chunk: chunks[i],},});}constresults=awaitclient.batch(stms,"write");console.log(results.length);client.close();
When I run this code, this is what I get:
thread '<unnamed>' panicked at src/statement.rs:360:62:
called `Option::unwrap()` on a `None` valuenote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
But if I instead use an HTTP client like postman, it all works fine. Am I doing something wrong here?
The text was updated successfully, but these errors were encountered:
Hey there,
I'm trying to use the FTS5 extension with libsql, but the Typescript client is failing to insert anything into the table. Here is my code:
When I run this code, this is what I get:
But if I instead use an HTTP client like postman, it all works fine. Am I doing something wrong here?
The text was updated successfully, but these errors were encountered: