Skip to content

Commit ea0577d

Browse files
committed
tests are passing
1 parent 6424dcc commit ea0577d

File tree

8 files changed

+46
-12
lines changed

8 files changed

+46
-12
lines changed

cache/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Building these WASM files requires the most recent version of TinyGo, which is
2+
difficult to compile / install. For now, we just include these in the PR.

cache/sqlc-codegen-go.wasm

1.06 MB
Binary file not shown.

cache/sqlc-codegen-kotlin.wasm

1.56 MB
Binary file not shown.

cache/sqlc-codegen-python.wasm

1.27 MB
Binary file not shown.

examples/wasm/gen/python/models.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Code generated by sqlc. DO NOT EDIT.
2+
import dataclasses
3+
from typing import Optional
4+
5+
6+
@dataclasses.dataclass()
7+
class Author:
8+
id: int
9+
name: str
10+
bio: Optional[str]

examples/wasm/gen/python/query.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Code generated by sqlc. DO NOT EDIT.
2+
from typing import Optional
3+
4+
import sqlalchemy
5+
6+
from import models
7+
8+
9+
CREATE_AUTHOR = """-- name: create_author \\:one
10+
INSERT INTO authors (
11+
name, bio
12+
) VALUES (
13+
:p1, :p2
14+
)
15+
RETURNING id, name, bio
16+
"""
17+
18+
19+
DELETE_AUTHOR = """-- name: delete_author \\:exec
20+
DELETE FROM authors
21+
WHERE id = :p1
22+
"""
23+
24+
25+
GET_AUTHOR = """-- name: get_author \\:one
26+
SELECT id, name, bio FROM authors
27+
WHERE id = :p1 LIMIT 1
28+
"""
29+
30+
31+
LIST_AUTHORS = """-- name: list_authors \\:many
32+
SELECT id, name, bio FROM authors
33+
ORDER BY name
34+
"""

examples/wasm/sqlc.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@
1111
"path": "../../cache/sqlc-codegen-python.wasm"
1212
}
1313
}
14-
},
15-
{
16-
"schema": "../authors/postgresql/schema.sql",
17-
"queries": "../authors/postgresql/query.sql",
18-
"engine": "postgresql",
19-
"gen": {
20-
"wasm": {
21-
"out": "gen/go",
22-
"path": "../../cache/sqlc-codegen-go.wasm"
23-
}
24-
}
2514
}
2615
]
2716
}

internal/cmd/generate.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer
218218
default:
219219
panic("missing language backend")
220220
}
221-
fmt.Println("out", out)
222221
resp, err := genfunc(codeGenRequest(result, combo))
223222
if region != nil {
224223
region.End()

0 commit comments

Comments
 (0)