How to use in browser environment?
Hi, I'm trying to use Drizzle ORM in browser with wa-sqlite, a SQLite WASM lib. There are no drivers for it.
How can I use it? I made my db execute function, which takes an sql string and a params array which I can basically call from Drizzle query builder / sql tag.
I mean the output of these:
Is this correct like this? I mean I made a function
executeQuery(selectSQL, selectParams)
which takes those exact outputs and it works.
I have some questions:
1. Do I understand correctly, that for create table statements, I need drizzle-kit and it's not compatible with browser envs?
2. Is it difficult to make a driver out of this? I mean it's a standard sqlite dialect. Can I tweak an existing driver to call my executeQuery?
3. What are the workaroiunds for using drizzle-kit / migrations with browser? I was thinking generating migrations files in a folder and just fetching those in the browser. I mean raw SQL statements. Would that work?2 Replies