Skip to content

Commit d209480

Browse files
committed
wip
1 parent 78d5081 commit d209480

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ let package = Package(
157157
)
158158

159159
// NB: For local testing in Xcode:
160-
if true {
161-
//if ProcessInfo.processInfo.environment["SPI_GENERATE_DOCS"] != nil {
160+
// if true {
161+
if ProcessInfo.processInfo.environment["SPI_GENERATE_DOCS"] != nil {
162162
package.traits.insert(
163163
.default(
164164
enabledTraits: [

Tests/StructuredQueriesTests/EnumTableTests.swift

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,25 @@
178178

179179
@Test func whereClause() {
180180
assertQuery(
181-
Attachment.where { $0.kind.note.is(Optional("Today was a good day")) }
181+
Attachment.where { $0.kind.is(Attachment.Kind.note("Today was a good day")) }
182+
) {
183+
"""
184+
SELECT "attachments"."id", "attachments"."link", "attachments"."note", "attachments"."videoURL", "attachments"."videoKind", "attachments"."imageCaption", "attachments"."imageURL"
185+
FROM "attachments"
186+
WHERE ("attachments"."link", "attachments"."note", "attachments"."videoURL", "attachments"."videoKind", "attachments"."imageCaption", "attachments"."imageURL") IS (NULL, 'Today was a good day', NULL, NULL, NULL, NULL)
187+
"""
188+
} results: {
189+
"""
190+
┌───────────────────────────────────────┐
191+
│ Attachment( │
192+
│ id: 2, │
193+
│ kind: .note("Today was a good day") │
194+
│ ) │
195+
└───────────────────────────────────────┘
196+
"""
197+
}
198+
assertQuery(
199+
Attachment.where { $0.kind.note.is("Today was a good day") }
182200
) {
183201
"""
184202
SELECT "attachments"."id", "attachments"."link", "attachments"."note", "attachments"."videoURL", "attachments"."videoKind", "attachments"."imageCaption", "attachments"."imageURL"

0 commit comments

Comments
 (0)