Skip to content

test: cover enum, array, and JSONB columns in the sample and fixtures - #54

Merged
omer-cengel merged 2 commits into
masterfrom
chore/enum-array-jsonb-sample-and-booktest-tests
Sep 29, 2026
Merged

omer-cengel merged 2 commits into
masterfrom
chore/enum-array-jsonb-sample-and-booktest-tests

Conversation

@omer-cengel

Copy link
Copy Markdown
Member

Summary

Extends the external sample and the PostgreSQL integration tests so that enum, array, and JSONB columns are generated, compiled, and executed end to end, including schema and query shapes modeled on sqlc's booktest example.

Changes

  • The sample gains a third migration that declares a book_format enum and adds format, tags TEXT[], and details JSONB columns to books.
  • Two new sample queries, CreateCatalogedBook and ListBooksByFormat, generate a shared BooksRow record and a top-level BookFormat enum; the sample application inserts a cataloged book and reads it back by format, checking the enum, the tag list, and the normalized JSONB text.
  • scripts/verify-release.sh resets the enum type, applies the new migration, and expects the shared BookFormat and BooksRow files, the updated source counts and manifest, and the new repository methods.
  • A new PostgreSQL integration test reproduces booktest's schema constructs with original names (serial keys, an inline reference, a unique defaulted column, an enum column with a default, timestamptz, a varchar[] column, indexes, and a dollar-quoted function) and its get, create, update, and ISBN-update query shapes, asserting the generated enum, row component types, parameter order, and round trips.

Scope and non-goals

  • No compiler, runtime, or documentation changes; this adds verification only.
  • booktest's title-and-year, tag-overlap, and function-call queries are not reproduced.
  • The existing sample migrations and queries are unchanged.

A new migration adds a book_format enum, a TEXT[] tags column, and a
JSONB details column to books. The sample inserts a cataloged book and
reads it back by format, and the release script applies the migration,
resets the enum type, and expects the shared BookFormat enum and
BooksRow record in every generation.
@omer-cengel
omer-cengel merged commit 9ade6ca into master Sep 29, 2026
6 checks passed
@omer-cengel
omer-cengel deleted the chore/enum-array-jsonb-sample-and-booktest-tests branch September 29, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant