We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29fcd86 commit ac6f814Copy full SHA for ac6f814
Tests/StructuredQueriesTests/DatabaseFunctionTests.swift
@@ -427,5 +427,29 @@ extension SnapshotTests {
427
"""
428
}
429
430
+
431
+ @DatabaseFunction
432
+ func isValidDraft(_ tag: Tag.Draft) -> Bool {
433
+ !tag.title.isEmpty
434
+ }
435
+ @Test func tableDraft() {
436
+ $isValidDraft.install(database.handle)
437
438
+ assertQuery(
439
+ Tag.Draft.select { $isValidDraft($0) }.limit(1)
440
+ ) {
441
+ """
442
+ SELECT "isValidDraft"("tags"."id", "tags"."title")
443
+ FROM "tags"
444
+ LIMIT 1
445
446
+ } results: {
447
448
+ ┌──────┐
449
+ │ true │
450
+ └──────┘
451
452
453
454
455
0 commit comments