Protocol
SQLSubqueryClauseBuilder
SELECT query. Useful for building CTEs, CREATE TABLE ... SELECT clauses, etc., not to mention actual SELECT queries.protocol SQLSubqueryClauseBuilder : SQLAliasedColumnListBuilder, SQLCommonTableExpressionBuilder, SQLJoinBuilder, SQLPartialResultBuilder, SQLPredicateBuilder, SQLSecondaryPredicateBuilder
Overview
Due to unfortunate naming choices which this API is now stuck with until a major version bump, this protocol is very easily confused with SQLSubqueryBuilder. For clarification, this protocol provides methods common to the construction of SELECT subqueries, whereas SQLSubqueryBuilder is a concrete type which conforms to this protocol and provides support for embedding SQLSubquery expressions in other queries.
Important
Despite the use of the term “subquery”, this builder does not provide methods for specifying subquery operators (e.g. ANY, SOME), nor does it enclose its result in grouping parenthesis, as all of these formations are context-specific and are the purview of builders that conform to this protocol.
Note
The primary motivation for the existence of this protocol is to make it easier to construct SELECT queries without specifying a database or providing the SQLQueryBuilder and SQLQueryFetcher methods in inappropriate contexts.
Topics
Instance Properties
Instance Methods
distinct()Adds aDISTINCTclause to the query.distinct(on:)Adds aDISTINCTclause to the select statement and explicitly specifies columns to select, overwriting any previously specified columns.distinct(on:_:)Adds aDISTINCTclause to the select statement and explicitly specifies columns to select, overwriting any previously specified columns.for(_:)Adds a locking clause to this query. If called more than once, the last call wins.from(_:)Include the given table in the list of those used by the query, without performing an explicit join.from(_:as:)Include the given table and an alias for it in the list of those used by the query, without performing an explicit join.groupBy(_:)Adds aGROUP BYclause to the query with the specified column.lockingClause(_:)Adds a locking clause to this query. If called more than once, the last call wins.
Relationships
Inherits From
SQLAliasedColumnListBuilderSQLCommonTableExpressionBuilderSQLJoinBuilderSQLPartialResultBuilderSQLPredicateBuilderSQLSecondaryPredicateBuilderSQLUnqualifiedColumnListBuilder
Conforming Types
See Also
Builder Protocols
SQLAliasedColumnListBuilderCommon definitions for query builders which permit specifying aliased column names.SQLColumnUpdateBuilderCommon definitions for query builders which support assigning values to columns.SQLJoinBuilderCommon definitions for any query builder which permits specifying joins.SQLPartialResultBuilderCommon definitions for any query builder which permits specifying range and ordering behaviors.SQLPredicateBuilderCommon definitions for any query builder which permits specifying a primary predicate.SQLQueryBuilderBase definitions for builders which set up queries and execute them against a given database.SQLQueryFetcherCommon definitions forSQLQueryBuilders which support retrieving result rows.SQLReturningBuilderCommon definitions for any query builder which can return values from data-mutating queries.SQLSecondaryPredicateBuilderCommon definitions for any query builder which permits specifying a secondary predicate.SQLUnqualifiedColumnListBuilderCommon definitions for query builders which permit or require specifying a list of unqualified column names.