You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Output: `ydb-python-sdk/models.py`, `queries.py` (or one `.py` per query file), `__init__.py`. Use `Querier(pool)` and call methods like `get_author(id=...)`; add the output dir to `PYTHONPATH` or use as package `db`.
75
+
76
+
### All plugins in one project
77
+
78
+
```yaml
79
+
version: "2"
80
+
81
+
engines:
82
+
- name: ydb
83
+
process:
84
+
cmd: sqlc-engine-ydb
85
+
86
+
plugins:
87
+
- name: ydb-go-sdk
88
+
process:
89
+
cmd: sqlc-gen-ydb-go-sdk
90
+
- name: ydb-database-sql
91
+
process:
92
+
cmd: sqlc-gen-ydb-database-sql
93
+
- name: ydb-python-sdk
94
+
process:
95
+
cmd: sqlc-gen-ydb-python-sdk
96
+
97
+
sql:
98
+
- engine: ydb
99
+
schema: "schema.sql"
100
+
queries: "queries.sql"
101
+
codegen:
102
+
- out: ydb-go-sdk
103
+
plugin: ydb-go-sdk
104
+
options:
105
+
package: db
106
+
- out: ydb-database-sql
107
+
plugin: ydb-database-sql
108
+
options:
109
+
package: db
110
+
- out: ydb-python-sdk
111
+
plugin: ydb-python-sdk
112
+
options:
113
+
package: db
114
+
```
115
+
116
+
Ensure the plugin binaries (`sqlc-engine-ydb`, `sqlc-gen-ydb-go-sdk`, etc.) are on `PATH` when you run `sqlc generate`.
5
117
6
118
## Generating code with Docker (recommended)
7
119
@@ -12,7 +124,7 @@ You don't need to install sqlc or plugins locally. Use the pre-built image (or b
12
124
docker run --rm -v "$(pwd):/src" -w /src ghcr.io/<owner>/sqlc-ydb:latest generate
13
125
```
14
126
15
-
Replace `<owner>` with the GitHub org/user that publishes the image (e.g. `sqlc-dev`). The image includes sqlc (from engine-plugin), **sqlc-engine-ydb**, **sqlc-gen-ydb-go-sdk**, and **sqlc-gen-ydb-database-sql**.
127
+
Replace `<owner>` with the GitHub org/user that publishes the image (e.g. `sqlc-dev`). The image includes sqlc (from engine-plugin), **sqlc-engine-ydb**, **sqlc-gen-ydb-go-sdk**, **sqlc-gen-ydb-database-sql**, and **sqlc-gen-ydb-python-sdk**.
16
128
17
129
To build the image locally (from the sqlc-ydb repo root):
18
130
@@ -44,4 +156,4 @@ The `examples/authors` project uses the v2 config with the **sqlc-engine-ydb** e
44
156
make examples
45
157
```
46
158
47
-
Generated files appear under each example in `examples/<name>/ydb-go-sdk/` and `examples/<name>/ydb-database-sql/` (`models.go`, `db.go`, `queries.sql.go`). The Makefile uses `bin/sqlc` from `make build-sqlc` by default; override with `make examples SQLC=/path/to/sqlc`.
159
+
Generated files appear under each example: `ydb-go-sdk/`and `ydb-database-sql/` (Go: `models.go`, `db.go`, `queries.sql.go`), `ydb-python-sdk/` (Python: `models.py`, `queries.py`, `__init__.py`). The Makefile uses `bin/sqlc` from `make build-sqlc` by default; override with `make examples SQLC=/path/to/sqlc`.
0 commit comments