Skip to content

jmattaa/sqlc-gen-ts

 
 

Repository files navigation

sqlc-gen-ts

Caution

This project is not finished on sqlc-gen-typescript Here i'm just tweaking it for my sqlite usage

Important

USE JAVY 3.2.0 and nothing greater cuz protobuf be complaining

Supported engines and drivers

Development

If you want to build and test sqlc-gen-typescript locally, follow these steps:

  1. Clone the repository and install dependencies:

    git clone https://github.com/jmattaa/sqlc-ts-sqlite.git
    cd sqlc-gen-typescript
    npm install
    
  2. Make your desired changes to the codebase. The main source files are located in the src directory.

  3. If you've made changes that require updating dependencies, run:

    npm install
    
  4. Build the WASM plugin:
    Check the Makefile for details.

    make out.js
    
    # Ensure you have Javy installed and available in your PATH
    make examples/plugin.wasm
    
  5. To test your local build, create a test project with a sqlc.yaml file containing:

    version: '2'
    plugins:
    - name: ts
      wasm:
        url: file://{path_to_your_local_wasm_file}
        sha256: {sha256_of_your_wasm_file}
    sql:
    - schema: "schema.sql"
      queries: "query.sql"
      engine: sqlite
      codegen:
      - out: db
        plugin: ts
        options:
          runtime: node
          driver: better-sqlite3

    Replace the placeholders with appropriate values for your setup.

  6. Run sqlc in your test project to generate TypeScript code using your local plugin build:

    sqlc generate
    

For more details on sqlc development, refer to the sqlc core development guide. This guide provides additional information on setting up and working with sqlc in general, which may be useful for contributors to this project.
https://docs.sqlc.dev/en/latest/guides/development.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.1%
  • Other 0.9%