Skip to content

swuecho/sqlc-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a436bf7 · Sep 1, 2024
Sep 1, 2024
May 6, 2023
May 6, 2023
Sep 1, 2024
Sep 1, 2024
May 4, 2023
May 6, 2023
May 10, 2023
May 6, 2023
May 14, 2023
May 14, 2023
May 5, 2023
May 5, 2023
May 5, 2023
May 14, 2023
May 14, 2023
May 6, 2023
Jan 19, 2023

Repository files navigation

sqlc-fs

sqlc-fs is a sqlc plugin to generate queries that are compatible with Npgsql.Fsharp.

This plugin is in alpha stage.

check https://github.com/swuecho/sqlc-fs/tree/main/testdata for demo.

Installation & Usage

go install github.com/swuecho/sqlc-fs@latest
// sqlc.json
{
  "version": "2",
  "plugins": [
    {
      "name": "fs",
      "process": {
        "cmd": "sqlc-fs"
      }
    }
  ],
   "sql": [
    {
      "schema": "schema.sql",
      "queries": "query/",
      "engine": "postgresql",
      "codegen": [
        {
          "out": "gen",
          "plugin": "fs",
          "options": {
            // options with default value
            // "emit_async_code": false,
            // "emit_auto_open_model": true,
            // "emit_model_file_name": "model_from_schema.fs",
            // "emit_model_name: "ModelFromSchema",
          }
        }
      ]
    }
  ]

Dev & Contribution

go build -o bin/sqlc-ts 

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

sqlc generate -f ./testdata/sqlc.json

CREDIT

the plugin is based on sqlc-ts, which is a very good starting point to write sqlc plugin.

About

sqlc (postgresql) plugin for f#

Resources

Stars

Watchers

Forks

Packages

No packages published