Skip to content

Add table include option#49

Merged
iamralch merged 2 commits into
mainfrom
feat/table-include-option
Jun 8, 2026
Merged

Add table include option#49
iamralch merged 2 commits into
mainfrom
feat/table-include-option

Conversation

@iamralch

@iamralch iamralch commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an options.tables.include allow-list alongside the existing exclude deny-list
  • when include is non-empty, only the listed tables are generated; an empty/omitted include generates every table (unchanged default)
  • exclude always takes precedence over include, so a table in both lists is skipped
  • both lists match unqualified (users) and schema-qualified (auth.accounts) table names
  • unify table selection into a single tableSelected predicate; document the option and add tests

Selection rules

include exclude Result
empty empty all tables (default)
empty set all except excluded
set empty only included
set set included minus excluded

This builds on the namespacing introduced in #46tables.include slots in non-breakingly next to tables.exclude.

Validation

  • go build ./...
  • go test ./...

Add an include allow-list alongside the existing exclude deny-list. When
include is non-empty, only the listed tables are generated; an empty include
matches all tables. Exclude always takes precedence over include.

Both lists match unqualified and schema-qualified table names. Selection is
unified in a single tableSelected predicate.
@iamralch iamralch self-assigned this Jun 8, 2026
@iamralch iamralch added the enhancement New feature or request label Jun 8, 2026
go.mod was bumped (inflect, ginkgo, gomega, urfave/cli) without
regenerating the Nix vendorHash, causing buildGoModule to build against
a stale vendor dir and fail with inconsistent vendoring.
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Code Metrics Report

Coverage Test Execution Time
83.9% 45s

Code coverage of files in pull request scope (80.7%)

Files Coverage
internal/sqlc/config.go 95.0%
internal/sqlc/generator.go 72.9%

Reported by octocov

@iamralch iamralch merged commit b2698bb into main Jun 8, 2026
6 checks passed
@iamralch iamralch deleted the feat/table-include-option branch June 8, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant