Skip to content
Prev Previous commit
Next Next commit
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>
  • Loading branch information
claude committed Oct 29, 2025
commit 0334db5c545c5982ef19c3f461c342a41cfd1e19
31 changes: 31 additions & 0 deletions internal/endtoend/testdata/duckdb_basic/duckdb/go/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions internal/endtoend/testdata/duckdb_basic/duckdb/go/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions internal/endtoend/testdata/duckdb_basic/duckdb/go/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions internal/endtoend/testdata/duckdb_basic/duckdb/query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- name: GetAuthor :one
SELECT id, name, bio FROM authors
WHERE id = $1;

-- name: ListAuthors :many
SELECT id, name, bio FROM authors
ORDER BY name;

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

-- name: DeleteAuthor :exec
DELETE FROM authors WHERE id = $1;
5 changes: 5 additions & 0 deletions internal/endtoend/testdata/duckdb_basic/duckdb/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE authors (
id INTEGER PRIMARY KEY,
name VARCHAR NOT NULL,
bio TEXT
);
9 changes: 9 additions & 0 deletions internal/endtoend/testdata/duckdb_basic/duckdb/sqlc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "2"
sql:
- engine: "duckdb"
schema: "schema.sql"
queries: "query.sql"
gen:
go:
package: "querytest"
out: "go"
Loading