Skip to content

a sqlc plugin for generating sql.js-compatible queries

Notifications You must be signed in to change notification settings

stephen/sqlc-ts

Repository files navigation

sqlc-ts

sqlc-ts is a sqlc plugin to generate queries that are compatible with @stephen/sql.js.

This plugin is early-stage and is not quite production ready.

Installation & Usage

$ go install github.com/kyleconroy/sqlc/cmd/sqlc@latest
$ go install github.com/stephen/sqlc-ts@latest
// sqlc.json
{
  "version": "2",
  "plugins": [
    {
      "name": "ts",
      "process": {
        "cmd": "sqlc-ts"
      }
    }
  ],
   "sql": [
    {
      "schema": "schema.sql",
      "queries": "query.sql",
      "engine": "sqlite",
      "codegen": [
        {
          "out": "gen",
          "plugin": "ts"
        }
      ]
    }
  ]
}

See testdata/ for a full example that can be run with:

$ sqlc generate -f ./testdata/sqlc.json && cat ./testdata/gen/query.sql.ts | less

About

a sqlc plugin for generating sql.js-compatible queries

Resources

Stars

Watchers

Forks

Packages

No packages published