Skip to content

feat(codegen): keyword-only arg/args for params-class methods - #7

Merged
kvdomingo merged 2 commits into
developmentfrom
feat/codegen/keyword-only-params-arg
Oct 19, 2026
Merged

kvdomingo merged 2 commits into
developmentfrom
feat/codegen/keyword-only-params-arg

Conversation

@kvdomingo

@kvdomingo kvdomingo commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Params-class arguments were the only positional parameter in generated querier methods. They are now keyword-only:

  • :copyfrom, :batchexec, :batchone, :batchmany → def create_authors(self, *, args: Sequence[CreateAuthorsParams])
  • other commands over query_parameter_limit (or with a limit of 0) → def update_author(self, *, arg: UpdateAuthorParams)

Batch commands use the same name as asavoy/alt-sqlc-gen-python (args), but the annotation stays Sequence[Params] rather than list[Params].

Callers now pass arg= / args=. The README migration notes cover both upstream and alt users.

Includes regenerated testdata/examples, updated hand-written protocol fakes, and the OpenSpec change keyword-only-params-arg. Verified with make test, mypy --strict on the feature-matrix and protocol fixtures, and pytest src/tests in examples/ against Postgres.

🤖 Generated with Claude Code

@kvdomingo
kvdomingo marked this pull request as ready for review October 19, 2026 16:22
kvdomingo and others added 2 commits October 20, 2026 00:23
Params-class arguments were the only positional parameter in generated
methods. They are now keyword-only: `arg` for single-call commands and
`args: Sequence[Params]` for :copyfrom and :batch* commands, matching
asavoy/alt-sqlc-gen-python's name for batch arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync the query-codegen delta into the main spec and move the change to
the archive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kvdomingo kvdomingo changed the title feat(codegen)!: keyword-only arg/args for params-class methods feat(codegen): keyword-only arg/args for params-class methods Oct 19, 2026
@kvdomingo
kvdomingo force-pushed the feat/codegen/keyword-only-params-arg branch from 5a48baf to 8813b36 Compare October 19, 2026 16:24
@kvdomingo
kvdomingo merged commit f693756 into development Oct 19, 2026
@kvdomingo
kvdomingo deleted the feat/codegen/keyword-only-params-arg branch October 19, 2026 16:29
kvdomingo added a commit that referenced this pull request Oct 19, 2026
* docs: gitbutler setup (#4)

* feat(overrides): add many option for list-wrapped override types (#3)

* docs: gitbutler setup

* docs(openspec): propose override many option

Add an OpenSpec change for a 'many' override flag that wraps py_type in a
list, so py_import works for lists of user types. py_import now requires a
single-identifier py_type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(overrides): add many option for list-wrapped override types

py_import with a generic py_type produced invalid imports. many: true wraps
the override type in a list; py_import now requires a single identifier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: [skip ci] archive override many spec

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* docs: [skip ci] bump to v1.1.0

* feat(codegen): keyword-only arg/args for params-class methods (#7)

* feat(codegen): keyword-only arg/args for params-class methods

Params-class arguments were the only positional parameter in generated
methods. They are now keyword-only: `arg` for single-call commands and
`args: Sequence[Params]` for :copyfrom and :batch* commands, matching
asavoy/alt-sqlc-gen-python's name for batch arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: [skip ci] archive keyword-only-params-arg spec

Sync the query-codegen delta into the main spec and move the change to
the archive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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