From 05c001865b80eb8581e8f6e218dd678ddc2cfc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 30 Apr 2020 09:12:57 +0200 Subject: [PATCH] Cleanup --- .../SQLGeneration/SQLGenerationContext.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift b/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift index 2716a7468..2f6aebac5 100644 --- a/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift +++ b/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift @@ -5,20 +5,19 @@ /// - It provides a database connection so that request elements can perform /// database introspection in order to build their SQL representation. /// -/// - It provides an "argumens sink" where request elements can dump database -/// values, in order to prevent SQL injection. -/// /// - It provides unique table aliases in order to disambiguates table names /// and columns. /// +/// - Request elements can turn database values as SQLite statement arguments, +/// in order to prevent SQL injection. +/// /// :nodoc: public struct SQLGenerationContext { /// A database connection so that request elements can perform database /// introspection in order to build their SQL representation. let db: Database - /// An argumens sink where request elements can dump database values, in - /// order to prevent SQL injection. + /// The arguments sink which prevents SQL injection. let argumentsSink: StatementArgumentsSink /// All arguments gathered so far @@ -111,8 +110,10 @@ class StatementArgumentsSink { self.init(rawSQL: false) } + // fileprivate so that SQLGenerationContext.append(arguments:) is the only + // available api. /// Returns whether arguments could be appended. - func append(arguments: StatementArguments) -> Bool { + fileprivate func append(arguments: StatementArguments) -> Bool { if arguments.isEmpty { return true }