Closed arjunyel closed 1 year ago
I'm not sure what's the proper solution here, because we have some contradictory requirements:
@libsql/client/web
import is explicitly intended to use only the Web-standard APIs (fetch
and WebSocket
)@libsql/client
import will not work on Workers, because it uses Node bindings to SQLiteworkerd
runtime and not Node.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?
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