version:'2'plugins:-name:pywasm:url:https://downloads.sqlc.dev/plugin/sqlc-gen-python_1.2.0.wasmsha256:a6c5d174c407007c3717eea36ff0882744346e6ba991f92f71d6ab2895204c0esql:-schema:"schema.sql"queries:"query.sql"engine:postgresqlcodegen: -out:src/authorsplugin:pyoptions:package:authorsemit_module:falseemit_generators:trueemit_async:false
If you have have a mono-repository setup you may want to split the output of queries and models. You can achieve this by using theoutput_models_file_name
andoutput_querier_file
fields. Ifoutput_models_file_name
is set tonull
for it will not output themodels.py
file. Settingoutput_querier_file
to false will prevent outputting any query files. Combining these you can set one codegen to only output models while the other codegen outputs only queries. Make sure thepackage
configuration is set equally so the query files import correctly the models.
SQLC needs at least one query, so you may need to add a unused query like the following in your schema and reuse theschema
asqueries
.
-- name: Skip :oneSELECT1;