Skip to content

"Unknown driver" when trying to use sqlite3 #43

Description

@marcusta

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?

Activity

  1. yshrsmz commented on Oct 16, 2024

    @yshrsmz
    Contributor

    #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.

  2. marcusta commented on Oct 16, 2024

    @marcusta
    Author

    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

  3. yshrsmz commented on Oct 17, 2024

    @yshrsmz
    Contributor

    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.

  4. tsukinoko-kun commented on Feb 22, 2025

    @tsukinoko-kun

    I have forked the repository, added proper sqlite support, and hosted it on gh pages:

    https://tsukinoko-kun.github.io/sqlc-gen-typescript/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions