"Unknown driver" when trying to use sqlite3 #43
Copy link
Copy link
Open
Description
Activity
#11 was merged in March, and the latest release (0.1.3) was released in January. So, it seems like the sqlite3 support has not yet been published.
Ah, thought it was there as it is documented in the README. And that example even references the version that seems to be the released one
wasm:
url: https://downloads.sqlc.dev/plugin/sqlc-gen-typescript_0.1.3.wasm
sha256: 287df8f6cc06377d67ad5ba02c9e0f00c585509881434d15ea8bd9fc751a9368sqlc can reference local wasm binary, so for now, you can build it yourself from the main branch.
#39
here's a PR regarding development instruction.I have forked the repository, added proper sqlite support, and hosted it on gh pages:
Reacted by Ilham AM
Metadata
Metadata
Assignees
Labels
No labels
Using the following yaml config
version: "2"
plugins:
wasm:
url: https://downloads.sqlc.dev/plugin/sqlc-gen-typescript_0.1.3.wasm
sha256: 287df8f6cc06377d67ad5ba02c9e0f00c585509881434d15ea8bd9fc751a9368
sql:
queries: "src/queries/customer.sql"
engine: "sqlite"
codegen:
plugin: ts
options:
runtime: node
driver: better-sqlite3
If I switch to mysql it works to generate.
I get the following error
➜ sqlc generate
package ts
error generating code: Error while running JS: Uncaught Error: unknown driver: better-sqlite3
at createNodeGenerator (function.mjs:190790)
at codegen (function.mjs:190799)
at (function.mjs:190776)
I have tried nodejs 20.9 and 20.18 and am running in zsh on mac (not bun). Installed sqlc using brew yesterday
I have better-sqlite3 installed as a dep in my project if that makes a difference or not.
Any ideas?