Skip to content

Commit 449130b

Browse files
committed
Fixed ios build
1 parent 3d18c64 commit 449130b

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

Sources/Compiler/Gen/SwiftLanguage.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,19 @@ public struct SwiftLanguage: Language {
336336
}
337337
}
338338
}
339-
writer.write(line: ")")
339+
writer.write(line: ") {")
340340

341341
writer.indent()
342342

343343
writer.write(line: name, "(")
344344
writer.indent()
345345

346-
for query in queries {
347-
writer.write(line: "self.", query.variableName, " = ", query.variableName)
346+
for (position, query) in queries.positional() {
347+
writer.write(line: query.variableName, ": ", query.variableName)
348+
349+
if !position.isLast {
350+
writer.write(",")
351+
}
348352
}
349353

350354
writer.unindent()

Sources/Otter/Cursor.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,25 @@ public struct Row: ~Copyable {
8888
return try Value(row: self, optionallyAt: column)
8989
}
9090

91+
/// Decodes the struct embeeded at the start index as the `Value` type.
92+
@inlinable public func embedded<Value: RowDecodableWithAdapters>(
93+
at column: Int32,
94+
as _: Value.Type = Value.self,
95+
adapters: Value.Adapters
96+
) throws(OtterError) -> Value {
97+
return try Value(row: self, startingAt: column, adapters: adapters)
98+
}
99+
100+
/// Decodes the struct embeeded at the start index as the `Value` type
101+
/// if it exists
102+
@inlinable public func optionallyEmbedded<Value: RowDecodableWithAdapters>(
103+
at column: Int32,
104+
as _: Value.Type = Value.self,
105+
adapters: Value.Adapters
106+
) throws(OtterError) -> Value? {
107+
return try Value(row: self, optionallyAt: column, adapters: adapters)
108+
}
109+
91110
/// Whether or not the column has a non null table at the column index
92111
@inlinable public func hasValue(at column: Int32) -> Bool {
93112
sqlite3_column_type(sqliteStatement, column) != SQLITE_NULL

Sources/Otter/Database.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ extension Adapters {
9898
public var uint: UIntDatabaseValueAdapter { UIntDatabaseValueAdapter() }
9999
public var float: FloatDatabaseValueAdapter { FloatDatabaseValueAdapter() }
100100
@available(macOS 11.0, *)
101+
@available(iOS 14.0, *)
101102
public var float16: Float16DatabaseValueAdapter { Float16DatabaseValueAdapter() }
102103
public var uuid: UUIDDatabaseValueAdapter { UUIDDatabaseValueAdapter() }
103104
public var decimal: DecimalDatabaseValueAdapter { DecimalDatabaseValueAdapter() }

0 commit comments

Comments
 (0)