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

prepare function doesn't throw an error for invalid SQL

Open wsporto opened this issue 1 year ago • 0 comments

Example:

import Database from "libsql";
const opts = {
    authToken: process.env.TURSO_AUTH_TOKEN || ''
} as any;

const db = new Database(process.env.TURSO_DATABASE_URL || '', opts)
console.log(db.prepare('select invalidcolumn')); //doesn't throw error;
console.log(db.prepare('select * as')); //throw error

Using the 'better-sqlite' driver it throws an error in both situations.

wsporto avatar May 02 '24 23:05 wsporto