Skip to content

Commit ff3f03d

Browse files
authored
examples: Port Python examples to WASM plugin (#1903)
1 parent c3fea58 commit ff3f03d

File tree

1 file changed

+46
-25
lines changed

1 file changed

+46
-25
lines changed

examples/python/sqlc.json

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,79 @@
11
{
22
"version": "2",
3+
"plugins": [
4+
{
5+
"name": "py",
6+
"wasm": {
7+
"url": "https://github.com/tabbed/sqlc-gen-python/releases/download/v0.16.0-alpha/sqlc-gen-python.wasm",
8+
"sha256": "428476c7408fd4c032da4ec74e8a7344f4fa75e0f98a5a3302f238283b9b95f2"
9+
},
10+
}
11+
],
312
"sql": [
413
{
514
"schema": "../authors/postgresql/schema.sql",
615
"queries": "../authors/postgresql/query.sql",
716
"engine": "postgresql",
8-
"gen": {
9-
"python": {
17+
"codegen": [
18+
{
1019
"out": "src/authors",
11-
"package": "authors",
12-
"emit_sync_querier": true,
13-
"emit_async_querier": true,
14-
"query_parameter_limit": 5
20+
"plugin": "py",
21+
"options": {
22+
"package": "authors",
23+
"emit_sync_querier": true,
24+
"emit_async_querier": true,
25+
"query_parameter_limit": 5
26+
}
1527
}
16-
}
28+
]
1729
},
1830
{
1931
"schema": "../booktest/postgresql/schema.sql",
2032
"queries": "../booktest/postgresql/query.sql",
2133
"engine": "postgresql",
22-
"gen": {
23-
"python": {
34+
"codegen": [
35+
{
2436
"out": "src/booktest",
25-
"package": "booktest",
26-
"emit_async_querier": true,
27-
"query_parameter_limit": 5
37+
"plugin": "py",
38+
"options": {
39+
"package": "booktest",
40+
"emit_async_querier": true,
41+
"query_parameter_limit": 5
42+
}
2843
}
29-
}
44+
]
3045
},
3146
{
3247
"schema": "../jets/schema.sql",
3348
"queries": "../jets/query-building.sql",
3449
"engine": "postgresql",
35-
"gen": {
36-
"python": {
50+
"codegen": [
51+
{
3752
"out": "src/jets",
38-
"package": "jets",
39-
"emit_async_querier": true,
40-
"query_parameter_limit": 5
53+
"plugin": "py",
54+
"options": {
55+
"package": "jets",
56+
"emit_async_querier": true,
57+
"query_parameter_limit": 5
58+
}
4159
}
42-
}
60+
]
4361
},
4462
{
4563
"schema": "../ondeck/postgresql/schema",
4664
"queries": "../ondeck/postgresql/query",
4765
"engine": "postgresql",
48-
"gen": {
49-
"python": {
66+
"codegen": [
67+
{
5068
"out": "src/ondeck",
51-
"package": "ondeck",
52-
"emit_async_querier": true,
53-
"query_parameter_limit": 5
69+
"plugin": "py",
70+
"options": {
71+
"package": "ondeck",
72+
"emit_async_querier": true,
73+
"query_parameter_limit": 5
74+
}
5475
}
55-
}
76+
]
5677
}
5778
]
5879
}

0 commit comments

Comments
 (0)