Skip to content

Conversation

stephencelis
Copy link
Member

Quick thing we noticed when working on an app.

let defaultValue: ExprSyntax? =
binding.initializer.map(\.value.trimmed)
// TODO: Revisit this with multi-column support.
// ?? (columnQueryValueType?.isOptionalType == true ? ExprSyntax(NilLiteralExprSyntax()) : nil)
Copy link
Member Author

Choose a reason for hiding this comment

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

We unfortunately can't automatically do = #bind(nil) because outer-joined tables aren't bindable:

var reminder: Reminder?

But if/when we figure out #108 we could revisit this.

@stephencelis stephencelis merged commit 75c7240 into main Sep 18, 2025
3 checks passed
@stephencelis stephencelis deleted the selection-defaults branch September 18, 2025 21:32
coenttb pushed a commit to coenttb/swift-structured-queries-postgres that referenced this pull request Oct 14, 2025
* Support defaults in `@Selection.Columns.init`

* Update Triggers.md
coenttb pushed a commit to coenttb/swift-structured-queries-postgres that referenced this pull request Oct 15, 2025
* Support defaults in `@Selection.Columns.init`

* Update Triggers.md
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.

2 participants