Skip to content

Commit 0334db5

Browse files
committed
Add proper endtoend test for DuckDB in testdata
Creates internal/endtoend/testdata/duckdb_basic/duckdb/ with: - schema.sql: Basic authors table - query.sql: CRUD operations (GetAuthor, ListAuthors, CreateAuthor, DeleteAuthor) - sqlc.yaml: DuckDB engine configuration - go/: Expected generated output (db.go, models.go, query.sql.go) Test automatically discovered by TestReplay and passes: ✅ TestReplay/base/duckdb_basic/duckdb (0.01s) This follows the project's endtoend testing conventions where tests live in internal/endtoend/testdata/ rather than just examples/. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e1bef7e commit 0334db5

File tree

6 files changed

+148
-0
lines changed

6 files changed

+148
-0
lines changed

internal/endtoend/testdata/duckdb_basic/duckdb/go/db.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/duckdb_basic/duckdb/go/models.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/duckdb_basic/duckdb/go/query.sql.go

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- name: GetAuthor :one
2+
SELECT id, name, bio FROM authors
3+
WHERE id = $1;
4+
5+
-- name: ListAuthors :many
6+
SELECT id, name, bio FROM authors
7+
ORDER BY name;
8+
9+
-- name: CreateAuthor :one
10+
INSERT INTO authors (name, bio)
11+
VALUES ($1, $2)
12+
RETURNING id, name, bio;
13+
14+
-- name: DeleteAuthor :exec
15+
DELETE FROM authors WHERE id = $1;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE TABLE authors (
2+
id INTEGER PRIMARY KEY,
3+
name VARCHAR NOT NULL,
4+
bio TEXT
5+
);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: "2"
2+
sql:
3+
- engine: "duckdb"
4+
schema: "schema.sql"
5+
queries: "query.sql"
6+
gen:
7+
go:
8+
package: "querytest"
9+
out: "go"

0 commit comments

Comments
 (0)