tursodatabase / tursodatabase/libsql-client-ts

Support for `opfs-ahp://` when creating a client to access OPFS via the SHA Pool

Open
#317 0 comments 0 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

Hi, we're looking to connect to an OPFS stored SQLLite instance running in WASM, however, we are required to use the SHA Pool for connection (we're unable to control/change the security headers from the server that would allow alternative OPFS approaches).

Ideally, this would work:

const sqlite3 = await sqlite3InitModule();
const poolUtil = await sqlite3.installOpfsSAHPoolVfs({ directory: '/data' });
const accessPool = new poolUtil.OpfsSAHPoolDb('my-db');

const client: Client = createClient({ url: `opfs-ahp://${accessPool.filename}` });

I appreciate that opfs-ahp is not a currently supported protocol, and I wanted to ask if this might be added in the future?

As a reference example, this is supported by PGLite

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 createClient entry point and compare the requested opfs-ahp:// URL with the PGLite reference at packages/pglite/src/fs/opfs-ahp.ts. Trace how the provided OpfsSAHPoolDb filename should be opened, and consider the sqlite.installOpfsSAHPoolVfs example as the expected integration context. Done means a client can connect through opfs-ahp:// using the SHA Pool.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript, wasm
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.