libsql-client-ts icon indicating copy to clipboard operation
libsql-client-ts copied to clipboard

read mode allows inserts & more

Open tmcw opened this issue 1 year ago • 1 comments

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.

tmcw avatar Mar 09 '24 16:03 tmcw

This shouldn't be possible, right? If we set the batch to read, then we shouldn't be able to create a table and insert data?

tmcw avatar Jul 31 '24 17:07 tmcw