Configure sqlc-gen-python in sqlc.yaml
mainTo use the Python generator, add it to the plugins section of your sqlc.yaml configuration file. You must specify the wasm URL and the sha256 checksum for the plugin. In the codegen section, set the plugin name to py and define your options such as package, emit_sync_querier, and emit_async_querier.
version: "2"
plugins:
- name: py
wasm:
url: https://downloads.sqlc.dev/plugin/sqlc-gen-python_1.3.0.wasm
sha256: fbedae96b5ecae2380a70fb5b925fd4bff58a6cfb1f3140375d098fbab7b3a3c
sql:
- schema: "schema.sql"
queries: "query.sql"
engine: postgresql
codegen:
- out: src/authors
plugin: py
options:
package: authors
emit_sync_querier: true
emit_async_querier: true