Row values

This commit is contained in:
Gwendal Roué committed 2020-12-12 12:40:49 +01:00
1 parent 18885d4ca1
commit b715206502
9 files changed
+90 -1

No files matched your search

@@ -870,6 +870,10 @@ private struct SQLExpressionIsTrue: _SQLExpressionVisitor {
try setFalse()
}
mutating func visit(_ expr: _SQLRowValue) throws {
try setFalse()
}
mutating func visit(_ expr: _SQLExpressionBetween) throws {
try setFalse()
}
@@ -995,6 +999,12 @@ private struct SQLExpressionIsConstantInRequest: _SQLExpressionVisitor {
try setNotConstant()
}
mutating func visit(_ expr: _SQLRowValue) throws {
for expression in expr.expressions {
try expression._accept(&self)
}
}
mutating func visit(_ expr: _SQLExpressionBetween) throws {
try expr.expression._accept(&self)
try expr.lowerBound._accept(&self)
@@ -1139,6 +1149,8 @@ private struct SQLTableColumnVisitor: _SQLExpressionVisitor {
}
}
mutating func visit(_ expr: _SQLRowValue) throws { }
mutating func visit(_ expr: _SQLExpressionBetween) throws { }
mutating func visit(_ expr: _SQLExpressionBinary) throws {
@@ -1243,6 +1255,7 @@ extension SQLExpression {
}
}
#warning("TODO: what should we do with _SQLRowValue? (a, b) == (1, 2) for example?")
/// Support for `SQLExpression.identifyingColums(_:for:)`
private struct SQLIdentifyingColumns: _SQLExpressionVisitor {
struct BreakError: Error { }
@@ -1256,6 +1269,8 @@ private struct SQLIdentifyingColumns: _SQLExpressionVisitor {
mutating func visit(_ column: _SQLQualifiedColumn) throws { }
mutating func visit(_ expr: _SQLRowValue) throws { }
mutating func visit(_ expr: _SQLExpressionBetween) throws { }
mutating func visit(_ expr: _SQLExpressionBinary) throws { }
@@ -1353,6 +1368,7 @@ extension SQLExpression {
}
}
#warning("TODO: what should we do with _SQLRowValue? (a, b) == (1, 2) for example?")
/// Support for `SQLExpression.identifyingRowIDs(_:for:)`
private struct SQLIdentifyingRowIDs: _SQLExpressionVisitor {
let db: Database
@@ -1369,6 +1385,8 @@ private struct SQLIdentifyingRowIDs: _SQLExpressionVisitor {
mutating func visit(_ column: _SQLQualifiedColumn) throws { }
mutating func visit(_ expr: _SQLRowValue) throws { }
mutating func visit(_ expr: _SQLExpressionBetween) throws { }
mutating func visit(_ expr: _SQLExpressionBinary) throws { }
@@ -1525,6 +1543,12 @@ private struct SQLSelectableIsAggregate: _SQLSelectableVisitor {
mutating func visit(_ selectable: _SQLQualifiedAllColumns) throws { }
mutating func visit(_ expr: _SQLRowValue) throws {
for expression in expr.expressions {
try expression._accept(&self)
}
}
mutating func visit(_ selectable: _SQLSelectionLiteral) throws {
// Don't know - assume not an aggregate
}