-
-
Notifications
You must be signed in to change notification settings - Fork 120
Add the missing .sql() helpers for various DatabaseQuery types to FluentSQL
#633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ng some comments.
…promise to stop using @_spi(). Because these previously public methods were SPI and explicitly documented as not being public in the near future, this is not a semver-major break.
…tom(_:), as using them always causes a fatalError()
… DatabaseQuery.Aggregate.Method, DatabaseQuery.Filter.Method, DatabaseQuery.Filter.Relation, DatabaseQuery.Join.Method, and DatabaseQuery.Sort.Direction.
ptoffy
approved these changes
Mar 29, 2025
|
|
||
| static var spaceIfNotAliased: String? { | ||
| return self.alias == nil ? self.space : nil | ||
| public static var spaceIfNotAliased: String? { |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended?
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It certainly is. But I completely forgot to mention it in the commit log or the PR description 😅
bwdmr
pushed a commit
to bwdmr/fluent-kit
that referenced
this pull request
Dec 17, 2025
…luentSQL (vapor#633) * Update dependency version requirements * A minor code formatting pass getting rid of excess `return`s and fixing some comments. * The package access modifier was introduced in Swift 5.9. Fulfill the promise to stop using @_spi(). Because these previously public methods were SPI and explicitly documented as not being public in the near future, this is not a semver-major break. * Deprecate DatabaseQuery.Limit.custom(_:) and DatabaseQuery.Offset.custom(_:), as using them always causes a fatalError() * Add .sql() helpers for DatabaseQuery.Action, DatabaseQuery.Aggregate, DatabaseQuery.Aggregate.Method, DatabaseQuery.Filter.Method, DatabaseQuery.Filter.Relation, DatabaseQuery.Join.Method, and DatabaseQuery.Sort.Direction. * Workaround for silly Swift 5.9 bug
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes are now available in 1.51.0
Adds
.sql(unsafeRaw:),.sql(embed:), and.sql(_:)helpers for the following types to FluentSQL:DatabaseQuery.ActionDatabaseQuery.AggregateDatabaseQuery.Aggregate.MethodDatabaseQuery.Filter.MethodDatabaseQuery.Filter.RelationDatabaseQuery.Join.MethodDatabaseQuery.Sort.DirectionAdditional changes:
Schema.spaceIfNotAliasedis nowpublic(it was previouslyinternal).FluentKittarget's product dependencies more explicit.DatabaseQuery.Limit.custom(_:)andDatabaseQuery.Offset.custom(_:)are now deprecated, reflecting the fact that any use of them causes an unconditionalfatalError(). Due to design limitations in SQLKit, it is not possible to implement them correctly instead of erroring.@_spihas been removed in favor of thepackageaccess modifier now that we require Swift 5.9. This removes public symbols from the API, but because those symbols were SPI and had been explicitly documented as becoming non-public as of 5.9, this does not constitute asemver-majorbreak. Anyone who was using the SPIs did so at their own risk.#ifcondition for one of the bits ofMirrorbypass logic (it still said<6instead of<6.1).returnkeyword, pretty much for the sole reason that I felt like doing it. Fixed a few incorrect comments and code style quirks along the way too, but only a few.