diff --git a/GRDB/QueryInterface/SQLGenerationContext.swift b/GRDB/QueryInterface/SQLGenerationContext.swift index fa27d6c94..b8fff15a8 100644 --- a/GRDB/QueryInterface/SQLGenerationContext.swift +++ b/GRDB/QueryInterface/SQLGenerationContext.swift @@ -20,6 +20,12 @@ public struct SQLGenerationContext { /// Used for SQLSelectQuery.makeSelectStatement() and SQLSelectQuery.makeDeleteStatement() static func queryGenerationContext(aliases: [TableAlias]) -> SQLGenerationContext { + // TODO: since 5d9fa76, in the lines below, we started uniquing aliases. + // Something tells me this is a wrong fix. We should try to investigate + // and maybe revert this change. I don't see why we'd really need to + // unique aliases, and I'm afraid we're hiding some latent bug + // somewhere else. + // Unique aliases, but with preserved ordering, so that we have stable SQL generation let uniqueAliases = aliases.reduce(into: [TableAlias]()) { if !$0.contains($1) { diff --git a/GRDB/QueryInterface/SQLRelation.swift b/GRDB/QueryInterface/SQLRelation.swift index cdb101d8a..32b56e4fc 100644 --- a/GRDB/QueryInterface/SQLRelation.swift +++ b/GRDB/QueryInterface/SQLRelation.swift @@ -18,7 +18,7 @@ /// /// Filter and ordering are actually "promises", which are only resolved /// when a database connection is available. This is how we can implement -/// requests such as `Record.filter(key: 1)` or `Record.orderedByPrimaryKey()`: +/// requests such as `Record.filter(key: 1)` or `Record.orderByPrimaryKey()`: /// both need a database connection in order to introspect the primary key. /// /// // SELECT * FROM player @@ -26,7 +26,7 @@ /// // ORDER BY code -- primary key infered from the database schema /// Country /// .filter(Column("continent") == "EU") -/// .orderedByPrimaryKey() +/// .orderByPrimaryKey() /// /// ## Children /// diff --git a/GRDB/QueryInterface/SQLSelectQueryGenerator.swift b/GRDB/QueryInterface/SQLSelectQueryGenerator.swift index cd8281fca..96ae7caf3 100644 --- a/GRDB/QueryInterface/SQLSelectQueryGenerator.swift +++ b/GRDB/QueryInterface/SQLSelectQueryGenerator.swift @@ -220,7 +220,7 @@ struct SQLSelectQueryGenerator { /// | | | | | | /// | | | | | • ordering /// | | | | • filterPromise -/// | | | • directJoins +/// | | | • joins /// | | • alias /// | • source /// • fullSelection