mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Xcode 14 RC doesn't ship with the Swift 5.6 stdlib
https://forums.swift.org/t/xcode-14-rc-cannot-specialize-protocol-type/60171
This commit is contained in:
1 parent
2a3318ef9a
commit
82b4d90a82
20 files changed
+119
-59
No files matched your search
@@ -209,7 +209,9 @@ extension SQLInterpolation {
|
||||
/// let request: SQLRequest<Player> = """
|
||||
/// SELECT * FROM player WHERE id IN \(ids)
|
||||
/// """
|
||||
public mutating func appendInterpolation(_ sequence: some Sequence<some SQLExpressible>) {
|
||||
public mutating func appendInterpolation<S>(_ sequence: S)
|
||||
where S: Sequence, S.Element: SQLExpressible
|
||||
{
|
||||
let e: [SQL.Element] = sequence.map { .expression($0.sqlExpression) }
|
||||
if e.isEmpty {
|
||||
appendLiteral("(SELECT NULL WHERE NULL)")
|
||||
@@ -235,14 +237,18 @@ extension SQLInterpolation {
|
||||
/// let request: SQLRequest<Player> = """
|
||||
/// SELECT * FROM player WHERE a IN \(expressions)
|
||||
/// """
|
||||
public mutating func appendInterpolation(_ sequence: some Sequence<any SQLExpressible>){
|
||||
public mutating func appendInterpolation<S>(_ sequence: S)
|
||||
where S: Sequence, S.Element == any SQLExpressible
|
||||
{
|
||||
appendInterpolation(sequence.lazy.map(\.sqlExpression))
|
||||
}
|
||||
|
||||
// When a value is both an expression and a sequence of expressions,
|
||||
// favor the expression side. Use case: Foundation.Data interpolation.
|
||||
/// :nodoc:
|
||||
public mutating func appendInterpolation(_ expressible: some SQLExpressible & Sequence<some SQLExpressible>) {
|
||||
public mutating func appendInterpolation<S>(_ expressible: S)
|
||||
where S: SQLExpressible, S: Sequence, S.Element: SQLExpressible
|
||||
{
|
||||
elements.append(.expression(expressible.sqlExpression))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user