-
Notifications
You must be signed in to change notification settings - Fork 65
Restore Swift 6.1 support #347
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,15 @@ public import StructuredQueriesCore | |
| named(allCasePaths), | ||
| named(_$Element) | ||
| ) | ||
| @attached(memberAttribute) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| public macro Table( | ||
| _ name: String = "", | ||
| schema schemaName: String = "" | ||
| ) = | ||
| #externalMacro( | ||
| module: "StructuredQueriesMacros", | ||
| type: "TableMacro" | ||
| ) | ||
| #else | ||
| @attached( | ||
| extension, | ||
|
|
@@ -67,16 +76,16 @@ public import StructuredQueriesCore | |
| named(tableName), | ||
| named(CodingKeys) | ||
| ) | ||
| @attached(memberAttribute) | ||
| public macro Table( | ||
| _ name: String = "", | ||
| schema schemaName: String = "" | ||
| ) = | ||
| #externalMacro( | ||
| module: "StructuredQueriesMacros", | ||
| type: "TableMacro" | ||
| ) | ||
| #endif | ||
| @attached(memberAttribute) | ||
| public macro Table( | ||
| _ name: String = "", | ||
| schema schemaName: String = "" | ||
| ) = | ||
| #externalMacro( | ||
| module: "StructuredQueriesMacros", | ||
| type: "TableMacro" | ||
| ) | ||
|
|
||
| /// Defines a "selection" of columns that can be decoded from a query. | ||
| /// | ||
|
|
@@ -144,6 +153,14 @@ public macro Table( | |
| named(allCasePaths), | ||
| named(_$Element) | ||
| ) | ||
| @attached(memberAttribute) | ||
| public macro Selection( | ||
| _ name: String = "" | ||
| ) = | ||
| #externalMacro( | ||
| module: "StructuredQueriesMacros", | ||
| type: "TableMacro" | ||
| ) | ||
| #else | ||
| @attached( | ||
| extension, | ||
|
|
@@ -171,15 +188,15 @@ public macro Table( | |
| named(tableName), | ||
| named(CodingKeys) | ||
| ) | ||
| @attached(memberAttribute) | ||
| public macro Selection( | ||
| _ name: String = "" | ||
| ) = | ||
| #externalMacro( | ||
| module: "StructuredQueriesMacros", | ||
| type: "TableMacro" | ||
| ) | ||
| #endif | ||
| @attached(memberAttribute) | ||
| public macro Selection( | ||
| _ name: String = "" | ||
| ) = | ||
| #externalMacro( | ||
| module: "StructuredQueriesMacros", | ||
| type: "TableMacro" | ||
| ) | ||
|
|
||
| /// Customizes a column generated by the ``/StructuredQueriesCore/Table`` protocol. | ||
| /// | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -395,17 +395,6 @@ extension QueryExpression where QueryValue == Bool { | |
| } | ||
| } | ||
|
|
||
| // NB: This overload is required due to an overload resolution bug of 'Updates[dynamicMember:]'. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noticed this was fixed by the recent JSON changes, so dropping it. |
||
| @_documentation(visibility: private) | ||
| public prefix func ! ( | ||
| expression: any QueryExpression<Bool> | ||
| ) -> some QueryExpression<Bool> { | ||
| func open(_ expression: some QueryExpression<Bool>) -> SQLQueryExpression<Bool> { | ||
| SQLQueryExpression(expression.not()) | ||
| } | ||
| return open(expression) | ||
| } | ||
|
|
||
| extension SQLQueryExpression<Bool> { | ||
| public mutating func toggle() { | ||
| self = Self(not()) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,12 +75,12 @@ extension QueryExpression where QueryValue: _OptionalPromotable { | |
| /// `NULL` when both expressions are equal. | ||
| public func nullif<Other: QueryExpression>( | ||
| _ other: Other | ||
| ) -> some QueryExpression<QueryValue._Optionalized> | ||
| ) -> SQLQueryExpression<QueryValue._Optionalized> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6.1 does not like this opaque result type. |
||
| where | ||
| Other.QueryValue: _OptionalPromotable, | ||
| Other.QueryValue._Optionalized == QueryValue._Optionalized | ||
| { | ||
| QueryFunction("nullif", self, other) | ||
| SQLQueryExpression(QueryFunction("nullif", self, other)) | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2840,7 +2840,7 @@ extension SnapshotTests { | |
| } | ||
| } | ||
|
|
||
| @Test func `@Selection with empty struct`() { | ||
| @Test("@Selection with empty struct") func selectionWithEmptyStruct() { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6.1 cannot build these identifiers. |
||
| assertMacro { | ||
| """ | ||
| @Selection | ||
|
|
@@ -4063,7 +4063,7 @@ extension SnapshotTests { | |
| } | ||
| } | ||
|
|
||
| @Test func `selection enum requires CasePaths trait`() { | ||
| @Test("selection enum requires CasePaths trait") func selectionEnumRequiresCasePathsTrait() { | ||
| assertMacro { | ||
| """ | ||
| @Selection enum Post { | ||
|
|
||
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.
6.1 can't scope traits this way without breaking dependents. If we want we could introduce another Package file for 6.2 or 6.3, wherever it's fixed.