Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unknown driver" when trying to use sqlite3 #43

Open
marcusta opened this issue Oct 16, 2024 · 3 comments
Open

"Unknown driver" when trying to use sqlite3 #43

marcusta opened this issue Oct 16, 2024 · 3 comments

Comments

@marcusta
Copy link

marcusta commented Oct 16, 2024

Using the following yaml config

version: "2"
plugins:

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?

@yshrsmz
Copy link
Contributor

yshrsmz commented 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
Copy link
Author

marcusta commented 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
Copy link
Contributor

yshrsmz commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants