sqlc-gen-py

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: MIT

README

sqlc-gen-py

sqlc-gen-py is a plugin for sqlc that generates an ORM (now, support SQLAlchemy only) for Python.

This softwaer forked from sqlc-gen-python and modified to generate ORM and MySQL support.

Usage

get sha256 hash of wasm file

curl -sSL https://github.com/zztkm/sqlc-gen-py/releases/download/v0.0.1/sqlc-gen-py.wasm.sha256

add plugin to sqlc.yaml

version: '2'
plugins:
- name: py
  wasm:
    url: https://github.com/zztkm/sqlc-gen-py/releases/download/v0.0.2/sqlc-gen-py.wasm
    sha256: <sha256 hash>
sql:
- schema: "schema.sql"
  queries: "query.sql"
  engine: mysql
  codegen:
  - out: gen/sqlc
    plugin: py
    options:
      package: .
      emit_sync_querier: true
      emit_sqlalchemy_models: false

Refs

Directories

Path Synopsis
cmd
ast

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL