tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
226 stars 32 forks source link

Allow file: with @libsql/client/web #21

Closed arjunyel closed 1 year ago

arjunyel commented 1 year ago

When locally developing with Cloudflare Workers it would be cool if I could use a local sqlite instance with file:

Here is how local sqlite is implemented in Miniflare https://github.com/cloudflare/miniflare/blob/master/packages/shared/src/sqlite.ts

honzasp commented 1 year ago

I'm not sure what's the proper solution here, because we have some contradictory requirements:

In other words, I understand that using a SQLite database for local development of Workers would be quite convenient, but it goes against the point of Miniflare, which aims to locally provide the same environment as Workers. I'm not sure how to resolve this; maybe we could provide a Worker-specific import such as @libsql/client/worker, which would support the Miniflare-specific hacks allowing the use of file: URLs locally?