Skip to content

Add :copyfrom support and validate unsupported query annotations#33

Merged
swuecho merged 3 commits intomainfrom
sqlc_feature
Apr 26, 2026
Merged

Add :copyfrom support and validate unsupported query annotations#33
swuecho merged 3 commits intomainfrom
sqlc_feature

Conversation

@swuecho
Copy link
Copy Markdown
Owner

@swuecho swuecho commented Apr 26, 2026

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5ad0f58c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread query.go
Comment on lines +159 to +160
func fsharpFieldAccessor(argName string, field Field) string {
return argName + "." + sdk.ToPascalCase(field.Name)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Support scalar args in :copyfrom field accessor

For :copyfrom queries with exactly one SQL parameter, buildQueries leaves Arg.Struct nil and the generated function takes seq<primitive>, but fsharpFieldAccessor always emits property access (arg.<Field>). In that case the template generates code like writer.Write(arg.Name) for seq<string>, which does not compile and breaks single-column copy-from generation (including nullable single-column inserts).

Useful? React with 👍 / 👎.

swuecho added 2 commits April 26, 2026 17:43
- Add support for `:execlastid` which executes an INSERT then calls `SELECT lastval()` on the same connection
- Remove previous error for unsupported `:execlastid` annotation
- Update parameter binding to accept configurable indentation for F# code generation
- Add test coverage for `:execlastid` generation and unknown command errors
- Update READ
@swuecho swuecho merged commit a869e49 into main Apr 26, 2026
1 check passed
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