-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Using the following yaml config
version: "2"
plugins:
- name: ts
wasm:
url: https://downloads.sqlc.dev/plugin/sqlc-gen-typescript_0.1.3.wasm
sha256: 287df8f6cc06377d67ad5ba02c9e0f00c585509881434d15ea8bd9fc751a9368
sql: - schema: "src/db/schema.sql"
queries: "src/queries/customer.sql"
engine: "sqlite"
codegen:- out: db
plugin: ts
options:
runtime: node
driver: better-sqlite3
- out: db
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?
Activity
yshrsmz commentedon Oct 16, 2024
#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.
marcusta commentedon Oct 16, 2024
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: 287df8f6cc06377d67ad5ba02c9e0f00c585509881434d15ea8bd9fc751a9368
yshrsmz commentedon Oct 17, 2024
sqlc 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.
tsukinoko-kun commentedon Feb 22, 2025
I have forked the repository, added proper sqlite support, and hosted it on gh pages:
https://tsukinoko-kun.github.io/sqlc-gen-typescript/