tursodatabase / tursodatabase/libsql-client-ts

Deno example in README.md doesn't work with files

Open
#138 16 comments 11 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

The following fails with Deno:

import { createClient } from "https://esm.sh/@libsql/client@0.4.0-pre.2/node";

const config = {
  url: "file:local.db"
};
const db = createClient(config);
const rs = await db.execute("SELECT * FROM users");
console.log(rs);
error: Uncaught Error: module "@libsql/darwin-arm64" not found
    at require (https://esm.sh/v135/libsql@0.2.0-pre.2/denonext/libsql.mjs:4:178)
    at https://esm.sh/v135/libsql@0.2.0-pre.2/denonext/libsql.mjs:5:1969
    at https://esm.sh/v135/libsql@0.2.0-pre.2/denonext/libsql.mjs:5:452
    at https://esm.sh/v135/libsql@0.2.0-pre.2/denonext/libsql.mjs:5:4899

this works, however:

import { createClient } from "npm:@libsql/client/node";

const config = {
  url: "file:local.db"
};
const db = createClient(config);
const rs = await db.execute("SELECT * FROM users");
console.log(rs);
penberg@vonneumann deno-example % vi example.ts
penberg@vonneumann deno-example % cat example.ts
//import { createClient } from "https://esm.sh/@libsql/client@0.4.0-pre.2/node";
import { createClient } from "npm:@libsql/client/node";

const config = {
  url: "file:local.db"
};
const db = createClient(config);
const rs = await db.execute("SELECT * FROM users");
console.log(rs);

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

Open README.md and reproduce the Deno file-backed example, comparing it with the working npm:@libsql/client/node import. Update the documented Deno example so the file URL works, then verify the snippet runs without the reported module-not-found error.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno, typescript
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.