mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Unify SQLGenerationContext
This commit is contained in:
1 parent
d67f4802d3
commit
e05b8b2b47
7 files changed
+22
-33
No files matched your search
@@ -64,7 +64,7 @@ struct SQLQueryGenerator: Refinable {
|
||||
// Build an SQK generation context with all aliases found in the query,
|
||||
// so that we can disambiguate tables that are used several times with
|
||||
// SQL aliases.
|
||||
let context = SQLGenerationContext.queryContext(db, argumentsSink: argumentsSink, aliases: relation.allAliases)
|
||||
let context = SQLGenerationContext(db, argumentsSink: argumentsSink, aliases: relation.allAliases)
|
||||
|
||||
var sql = "SELECT"
|
||||
|
||||
@@ -274,7 +274,7 @@ struct SQLQueryGenerator: Refinable {
|
||||
return try makeTrivialDeleteStatement(db)
|
||||
}
|
||||
|
||||
let context = SQLGenerationContext.queryContext(db, aliases: relation.allAliases)
|
||||
let context = SQLGenerationContext(db, aliases: relation.allAliases)
|
||||
|
||||
var sql = try "DELETE FROM " + relation.source.sql(context)
|
||||
|
||||
@@ -314,7 +314,7 @@ struct SQLQueryGenerator: Refinable {
|
||||
fatalError("Can't delete without any database table")
|
||||
}
|
||||
|
||||
let context = SQLGenerationContext.sqlLiteralContext(db)
|
||||
let context = SQLGenerationContext(db)
|
||||
let primaryKey = try db.primaryKeyExpression(tableName)
|
||||
|
||||
var sql = "DELETE FROM \(tableName.quotedDatabaseIdentifier) WHERE "
|
||||
@@ -355,7 +355,7 @@ struct SQLQueryGenerator: Refinable {
|
||||
return nil
|
||||
}
|
||||
|
||||
let context = SQLGenerationContext.queryContext(db, aliases: relation.allAliases)
|
||||
let context = SQLGenerationContext(db, aliases: relation.allAliases)
|
||||
|
||||
var sql = "UPDATE "
|
||||
|
||||
@@ -418,7 +418,7 @@ struct SQLQueryGenerator: Refinable {
|
||||
return nil
|
||||
}
|
||||
|
||||
let context = SQLGenerationContext.sqlLiteralContext(db)
|
||||
let context = SQLGenerationContext(db)
|
||||
let primaryKey = try db.primaryKeyExpression(tableName)
|
||||
|
||||
// UPDATE table...
|
||||
|
||||
Reference in new issue
Block a user