packages feed

sqlc-hs 0.1.0.0 → 0.1.0.1

raw patch · 2 files changed

+45/−2 lines, 2 files

Files

+ README.md view
@@ -0,0 +1,42 @@+# sqlc-hs++A Haskell code generator plugin for [sqlc](https://github.com/kyleconroy/sqlc), allowing you to generate idiomatic Haskell types and functions directly from your SQL queries.++It leverages [postgresql-simple](https://hackage.haskell.org/package/postgresql-simple), [mysql-simple](https://hackage.haskell.org/package/mysql-simple), and [sqlite-simple](https://hackage.haskell.org/package/sqlite-simple), generating a thin layer on top of these well-known libraries.++Use below configuation in your sqlc.yaml to use sqlc-hs. Refer to the [sqlc documentation](+https://docs.sqlc.dev/en/latest/guides/plugins.html) for more information++```yaml+version: '2'+plugins:+  - name: haskell+    process:+      cmd: sqlc-hs+```++Use the plugin for your schemas like so++```yaml+  codegen:+  - out: gen+    plugin: haskell+    options:+      cabal_package_name: your-package+      cabal_package_version: 0.1.0.0+      haskell_module_prefix: Database.Queries+      overrides:+        db_type: bytea+        haskell_type:+          package: bytestring+          module: Data.ByteString+          type: Data.ByteString.ByteString+```++Ensure that the sqlc-hs executable is on your PATH when invoking sqlc.++# (Re-)Generate proto files with proto-lens++```+$ protoc --plugin=protoc-gen-haskell=`cabal exec which proto-lens-protoc` --haskell_out=sqlc-hs-protos/ protos/codegen.proto+```
sqlc-hs.cabal view
@@ -1,13 +1,13 @@ cabal-version:      3.4 name:               sqlc-hs-version:            0.1.0.0+version:            0.1.0.1  -- synopsis: -- description: license:            Apache-2.0 license-file:       LICENSE author:             Alex Hansen-maintainer:         alex.hansen@gmail.com+maintainer:         alex.biehl@gmail.com homepage:           https://github.com/alexbiehl/sqlc-hs bug-reports:        https://github.com/alexbiehl/sqlc-hs/issues category:           Development@@ -18,6 +18,7 @@ build-type:         Simple extra-doc-files:    CHANGELOG.md extra-source-files:+  README.md   templates/internal.mysql.hs.jinja   templates/internal.postgresql.hs.jinja   templates/internal.sqlite.hs.jinja