Skip to content

Commit 67ae4d1

Browse files
committed
void input extension
1 parent 185fb8b commit 67ae4d1

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

Sources/Compiler/Gen/SwiftGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public struct SwiftGenerator: Language {
160160
return "()"
161161
}
162162

163-
return generatedInputType?.name ?? swiftType(for: firstParam.type)
163+
return generatedInputType.map { "DB.\($0.name)" } ?? swiftType(for: firstParam.type)
164164
}
165165

166166
private static func outputType(
@@ -177,7 +177,7 @@ public struct SwiftGenerator: Language {
177177
return table.capitalizedFirst
178178
}
179179

180-
let type = generatedOutputType?.name ?? swiftType(for: firstColumn.root)
180+
let type = generatedOutputType.map { "DB.\($0.name)" } ?? swiftType(for: firstColumn.root)
181181

182182
return switch statement.outputCardinality {
183183
case .single: type

Sources/Feather/Query.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ public extension Query where Input == () {
1818
func execute() async throws -> Output {
1919
return try await execute(with: ())
2020
}
21+
22+
func observe() -> any QueryObservation<Output> {
23+
return observe(with: ())
24+
}
2125
}

Sources/Feather/Queryable.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,8 @@ public extension DatabaseQuery where Input == () {
4949
func execute(tx: borrowing Transaction) throws -> Output {
5050
return try execute(with: (), tx: tx)
5151
}
52+
53+
func observe(in database: any Database) -> any QueryObservation<Output> {
54+
return observe(with: (), in: database)
55+
}
5256
}

0 commit comments

Comments
 (0)