Skip to content

Commit

Permalink
Merge pull request #49 from vapor/sql-2-1
Browse files Browse the repository at this point in the history
sql 2.1 updates
  • Loading branch information
tanner0101 authored Sep 20, 2018
2 parents 635ad49 + 8f6b598 commit ad2e9bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Sources/SQLite/SQL/SQLiteAlterTableBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extension SQLAlterTableBuilder where Connection.Query.AlterTable == SQLiteAlterTable {
extension SQLAlterTableBuilder where Connectable.Connection.Query.AlterTable == SQLiteAlterTable {
/// Renames the table.
///
/// conn.alter(table: Bar.self).rename(to: "foo").run()
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/SQL/SQLiteCreateTable.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extension SQLCreateTableBuilder where Connection.Query.CreateTable == SQLiteCreateTable {
extension SQLCreateTableBuilder where Connectable.Connection.Query.CreateTable == SQLiteCreateTable {
/// By default, every row in SQLite has a special column, usually called the "rowid", that uniquely identifies that row within
/// the table. However if the phrase "WITHOUT ROWID" is added to the end of a CREATE TABLE statement, then the special "rowid"
/// column is omitted. There are sometimes space and performance advantages to omitting the rowid.
Expand Down
12 changes: 6 additions & 6 deletions Sources/SQLite/SQL/SQLiteDropIndex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ public struct SQLiteDropIndex: SQLDropIndex {
}

/// SQLite specific drop index builder.
public final class SQLiteDropIndexBuilder<Connection>: SQLQueryBuilder
where Connection: SQLConnection, Connection.Query == SQLiteQuery
public final class SQLiteDropIndexBuilder<Connectable>: SQLQueryBuilder
where Connectable: SQLConnectable, Connectable.Connection.Query == SQLiteQuery
{
/// `AlterTable` query being built.
public var dropIndex: SQLiteDropIndex

/// See `SQLQueryBuilder`.
public var connection: Connection
public var connectable: Connectable

/// See `SQLQueryBuilder`.
public var query: SQLiteQuery {
return .dropIndex(dropIndex)
}

/// Creates a new `SQLCreateIndexBuilder`.
public init(_ dropIndex: SQLiteDropIndex, on connection: Connection) {
public init(_ dropIndex: SQLiteDropIndex, on connectable: Connectable) {
self.dropIndex = dropIndex
self.connection = connection
self.connectable = connectable
}
}


extension SQLConnection where Query == SQLiteQuery {
extension SQLConnectable where Connection.Query == SQLiteQuery {
/// Drops an index from a SQLite database.
public func drop(index identifier: SQLiteIdentifier) -> SQLiteDropIndexBuilder<Self> {
return .init(SQLiteDropIndex(identifier: identifier), on: self)
Expand Down

0 comments on commit ad2e9bc

Please sign in to comment.