Skip to content

Commit 0df44cc

Browse files
committed
wip
1 parent e325781 commit 0df44cc

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Tests/StructuredQueriesTests/CustomFunctionTests.swift

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ extension SnapshotTests {
2828
}
2929
}
3030

31+
32+
33+
34+
35+
36+
37+
38+
39+
3140
// ---
3241
import Foundation
3342
import SQLite3
@@ -49,6 +58,34 @@ func _$dateTime(
4958
var __$dateTime: CustomFunction<String?, Date, Never> {
5059
CustomFunction("dateTime", isDeterministic: false, body: dateTime(_:))
5160
}
61+
62+
//struct DateTime: DatabaseFunction {
63+
// typealias Input = String?
64+
////
65+
// typealias Output = Date
66+
////
67+
// typealias Failure = Never
68+
////
69+
// typealias Result = SQLQueryExpression<Date>
70+
//
71+
// let name = "dateTime"
72+
// let isDeterministic = false
73+
// func callAsFunction(
74+
// _ input: some QueryExpression<String?> = String?.none
75+
// ) -> Result {
76+
// SQLQueryExpression("\(quote: name)(\(input))")
77+
// }
78+
//}
79+
// ---
80+
//protocol DatabaseFunction<Input, Output, Failure> {
81+
// associatedtype Input
82+
// associatedtype Output: QueryBindable where Output.QueryValue == Result.QueryValue
83+
// associatedtype Failure: Error
84+
// associatedtype Result: QueryExpression
85+
// var name: String { get }
86+
// var isDeterministic: Bool { get }
87+
// func callAsFunction(_ input: some QueryExpression<Input>) throws(Failure) -> Result
88+
//}
5289
// ---
5390
// Library code:
5491
@available(macOS 14, *)

0 commit comments

Comments
 (0)