tursodatabase / tursodatabase/libsql-js

prepare function doesn't throw an error for invalid SQL

Open
#108 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api compat bug help wanted
Dominant language
JavaScript
Stars
335
Forks
48
Avg merge
3d 2h
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the db.prepare entry point and reproduce both SQL examples from the issue, comparing their behavior with the better-sqlite driver. Trace how invalid-column and invalid-syntax statements are handled, and consider the issue done when both invalid statements consistently throw errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.