Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test both WASM and process-based
  • Loading branch information
kyleconroy committed Aug 29, 2023
commit fb88b7f446da1cf4869871fcfc29924aee73d0b0
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
run: go install gotest.tools/gotestsum@latest

- name: install sqlc-gen-test
run: go install github.com/sqlc-dev/sqlc-gen-test@main
run: go install github.com/sqlc-dev/sqlc-gen-test@v0.1.0

- name: install ./...
run: go install ./...
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"env": [
"SQLC_VERSION=v1.20.0",
"SQLC_DUMMY_VALUE=true"
]
}
19 changes: 19 additions & 0 deletions internal/endtoend/testdata/wasm_plugin_sqlc_gen_test/query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- name: GetAuthor :one
SELECT * FROM authors
WHERE id = $1 LIMIT 1;

-- name: ListAuthors :many
SELECT * FROM authors
ORDER BY name;

-- name: CreateAuthor :one
INSERT INTO authors (
name, bio
) VALUES (
$1, $2
)
RETURNING *;

-- name: DeleteAuthor :exec
DELETE FROM authors
WHERE id = $1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
bio text
);
26 changes: 26 additions & 0 deletions internal/endtoend/testdata/wasm_plugin_sqlc_gen_test/sqlc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "2",
"sql": [
{
"schema": "schema.sql",
"queries": "query.sql",
"engine": "postgresql",
"codegen": [
{
"out": "gen",
"plugin": "test"
}
]
}
],
"plugins": [
{
"name": "test",
"env": ["SQLC_DUMMY_VALUE"],
"wasm": {
"url": "https://github.com/sqlc-dev/sqlc-gen-test/releases/download/v0.1.0/sqlc-gen-test.wasm",
"sha256": "138220eae508d4b65a5a8cea555edd155eb2290daf576b7a8b96949acfeb3790"
}
}
]
}