tursodatabase / tursodatabase/libsql-client-ts

read mode allows inserts & more

Open
#188 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
576
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Quick demo:

import { createClient } from "@libsql/client";

const client = createClient({
  url: ":memory:",
});

console.log(
  await client.batch(
    ["CREATE TABLE x(y)", "INSERT INTO x(y) VALUES (1)", "SELECT * from x"],
    "read",
  ),
);

This probably shouldn't be possible. It seems that this is also possible with a non-memory database. I can't really see whether read mode makes any difference to queries at all.

Contributor guide

Open the contributing guide

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 client.batch call shown in the issue and trace how the "read" mode is handled for the listed CREATE, INSERT, and SELECT statements. Reproduce the example with an in-memory database and a non-memory database; done means read mode's write behavior is defined and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript
Domain
api, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.