mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Experiment with API diff
This commit is contained in:
1 parent
973da2de61
commit
6566f3f83d
2 files changed
-451
No files matched your search
@@ -4,48 +4,39 @@ import GRDB.GRDB_Bridging
|
||||
import GRDB
|
||||
import GRDB.Swift
|
||||
import SQLiteMacOSX
|
||||
|
||||
public var GRDB_VersionNumber: Double
|
||||
extension ClosedInterval where Bound : _SQLExpressionType {
|
||||
public func contains(element: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension ClosedInterval where Bound : _SQLExpressionType {
|
||||
public func contains(element: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension Double : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Double?
|
||||
}
|
||||
|
||||
extension NSString : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension NSURL : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension Int32 : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Int32?
|
||||
}
|
||||
|
||||
extension Range where Element : protocol<_SQLExpressionType, BidirectionalIndexType> {
|
||||
public func contains(element: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension Int : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Int?
|
||||
}
|
||||
|
||||
extension Optional where Wrapped : DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch(statement: GRDB.SelectStatement, arguments: GRDB.StatementArguments? = default) -> GRDB.DatabaseSequence<Wrapped?>
|
||||
@@ -56,239 +47,151 @@ extension Optional where Wrapped : DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchAll(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> [Wrapped?]
|
||||
}
|
||||
|
||||
extension Optional where Wrapped : DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<Wrapped?>
|
||||
@warn_unused_result
|
||||
public static func fetchAll<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> [Wrapped?]
|
||||
}
|
||||
|
||||
extension NSDate : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension NSData : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension NSNull : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension String : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> String?
|
||||
}
|
||||
|
||||
extension String {
|
||||
public var quotedDatabaseIdentifier: String { get }
|
||||
}
|
||||
|
||||
extension Int64 : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Int64?
|
||||
}
|
||||
|
||||
extension HalfOpenInterval where Bound : _SQLExpressionType {
|
||||
public func contains(element: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension HalfOpenInterval where Bound : _SQLExpressionType {
|
||||
public func contains(element: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension CGFloat : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> CGFloat?
|
||||
}
|
||||
|
||||
extension RawRepresentable where Self : DatabaseValueConvertible, Self.RawValue : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension Bool : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Bool?
|
||||
}
|
||||
|
||||
extension NSNumber : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension SequenceType where Self.Generator.Element : _SQLExpressionType {
|
||||
public func contains(element: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension SequenceType where Self.Generator.Element : _SQLExpressionType {
|
||||
public func contains(element: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension Float : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Float?
|
||||
}
|
||||
|
||||
prefix public func !(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: protocol<_SQLExpressionType, BooleanType>?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLDerivedExpressionType, rhs: protocol<_SQLExpressionType, BooleanType>?) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLExpressionType?, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: _SQLExpressionType?, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func &&(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func &&(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func &&(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func *(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func *(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func *(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func +(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func +(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func +(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
prefix public func -(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func -(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func -(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func -(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func /(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func /(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func /(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: _SQLExpressionType, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: _SQLExpressionType, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB.Row, rhs: GRDB.Row) -> Bool
|
||||
|
||||
public func ==(lhs: GRDB.RowIndex, rhs: GRDB.RowIndex) -> Bool
|
||||
|
||||
public func ==(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB.DatabaseValue, rhs: GRDB.DatabaseValue) -> Bool
|
||||
|
||||
public func ==(lhs: _SQLExpressionType?, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB.DatabaseCollation, rhs: GRDB.DatabaseCollation) -> Bool
|
||||
|
||||
public func ==(lhs: _SQLDerivedExpressionType, rhs: protocol<_SQLExpressionType, BooleanType>?) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB.DatabaseFunction, rhs: GRDB.DatabaseFunction) -> Bool
|
||||
|
||||
public func ==(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: protocol<_SQLExpressionType, BooleanType>?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: _SQLExpressionType?, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: _SQLExpressionType, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: _SQLExpressionType, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ??(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ??(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public typealias BusyCallback = (numberOfTries: Int) -> Bool
|
||||
|
||||
public enum BusyMode {
|
||||
case ImmediateError
|
||||
case Timeout(NSTimeInterval)
|
||||
case Callback(GRDB.BusyCallback)
|
||||
}
|
||||
|
||||
public enum CheckpointMode : Int32 {
|
||||
case Passive
|
||||
case Full
|
||||
case Restart
|
||||
case Truncate
|
||||
}
|
||||
|
||||
public struct Configuration {
|
||||
public var foreignKeysEnabled: Bool
|
||||
public var readonly: Bool
|
||||
@@ -298,12 +201,10 @@ public struct Configuration {
|
||||
public var busyMode: GRDB.BusyMode
|
||||
public init()
|
||||
}
|
||||
|
||||
final public class Database {
|
||||
public let configuration: GRDB.Configuration
|
||||
public let sqliteConnection: GRDB.SQLiteConnection
|
||||
}
|
||||
|
||||
extension Database {
|
||||
@warn_unused_result
|
||||
public func selectStatement(sql: String) throws -> GRDB.SelectStatement
|
||||
@@ -311,49 +212,40 @@ extension Database {
|
||||
public func updateStatement(sql: String) throws -> GRDB.UpdateStatement
|
||||
public func execute(sql: String, arguments: GRDB.StatementArguments? = default) throws -> GRDB.DatabaseChanges
|
||||
}
|
||||
|
||||
extension Database {
|
||||
public func addFunction(function: GRDB.DatabaseFunction)
|
||||
public func removeFunction(function: GRDB.DatabaseFunction)
|
||||
}
|
||||
|
||||
extension Database {
|
||||
public func addCollation(collation: GRDB.DatabaseCollation)
|
||||
public func removeCollation(collation: GRDB.DatabaseCollation)
|
||||
}
|
||||
|
||||
extension Database {
|
||||
public func clearSchemaCache()
|
||||
public func tableExists(tableName: String) -> Bool
|
||||
}
|
||||
|
||||
extension Database {
|
||||
public func inTransaction(kind: GRDB.TransactionKind? = default, @noescape _ block: () throws -> GRDB.TransactionCompletion) throws
|
||||
public func addTransactionObserver(transactionObserver: TransactionObserverType)
|
||||
public func removeTransactionObserver(transactionObserver: TransactionObserverType)
|
||||
}
|
||||
|
||||
public struct DatabaseChanges {
|
||||
public let changedRowCount: Int
|
||||
public let insertedRowID: Int64?
|
||||
}
|
||||
|
||||
public struct DatabaseCoder : DatabaseValueConvertible {
|
||||
public let object: AnyObject
|
||||
public init?(_ object: AnyObject?)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> GRDB.DatabaseCoder?
|
||||
}
|
||||
|
||||
final public class DatabaseCollation {
|
||||
public let name: String
|
||||
public init(_ name: String, function: (String, String) -> NSComparisonResult)
|
||||
}
|
||||
|
||||
extension DatabaseCollation : Hashable {
|
||||
public var hashValue: Int { get }
|
||||
}
|
||||
|
||||
extension DatabaseCollation {
|
||||
public class let unicodeCompare: GRDB.DatabaseCollation
|
||||
public class let caseInsensitiveCompare: GRDB.DatabaseCollation
|
||||
@@ -361,7 +253,6 @@ extension DatabaseCollation {
|
||||
public class let localizedCompare: GRDB.DatabaseCollation
|
||||
public class let localizedStandardCompare: GRDB.DatabaseCollation
|
||||
}
|
||||
|
||||
public struct DatabaseDateComponents : DatabaseValueConvertible {
|
||||
public enum Format : String {
|
||||
case YMD
|
||||
@@ -378,18 +269,15 @@ public struct DatabaseDateComponents : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> GRDB.DatabaseDateComponents?
|
||||
}
|
||||
|
||||
public struct DatabaseError : ErrorType {
|
||||
public let code: Int32
|
||||
public let message: String?
|
||||
public let sql: String?
|
||||
public init(code: Int32 = default, message: String? = default, sql: String? = default, arguments: GRDB.StatementArguments? = default)
|
||||
}
|
||||
|
||||
extension DatabaseError : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public struct DatabaseEvent {
|
||||
public enum Kind : Int32 {
|
||||
case Insert
|
||||
@@ -401,50 +289,41 @@ public struct DatabaseEvent {
|
||||
public var tableName: String { get }
|
||||
public let rowID: Int64
|
||||
}
|
||||
|
||||
final public class DatabaseFunction {
|
||||
public let name: String
|
||||
public init(_ name: String, argumentCount: Int32? = default, pure: Bool = default, function: [GRDB.DatabaseValue] throws -> DatabaseValueConvertible?)
|
||||
}
|
||||
|
||||
extension DatabaseFunction {
|
||||
public func apply(arguments: _SQLExpressionType...) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension DatabaseFunction : Hashable {
|
||||
public var hashValue: Int { get }
|
||||
}
|
||||
|
||||
extension DatabaseFunction {
|
||||
public class let capitalizedString: GRDB.DatabaseFunction
|
||||
public class let lowercaseString: GRDB.DatabaseFunction
|
||||
public class let uppercaseString: GRDB.DatabaseFunction
|
||||
}
|
||||
|
||||
extension DatabaseFunction {
|
||||
public class let localizedCapitalizedString: GRDB.DatabaseFunction
|
||||
public class let localizedLowercaseString: GRDB.DatabaseFunction
|
||||
public class let localizedUppercaseString: GRDB.DatabaseFunction
|
||||
}
|
||||
|
||||
public class DatabaseGenerator<Element> : GeneratorType {
|
||||
@warn_unused_result
|
||||
public func next() -> Element?
|
||||
}
|
||||
|
||||
public struct DatabaseMigrator {
|
||||
public init()
|
||||
public mutating func registerMigration(identifier: String, withDisabledForeignKeyChecks disabledForeignKeyChecks: Bool = default, migrate: (GRDB.Database) throws -> Void)
|
||||
public func migrate(db: DatabaseWriter) throws
|
||||
}
|
||||
|
||||
final public class DatabasePool {
|
||||
public init(path: String, configuration: GRDB.Configuration = default, maximumReaderCount: Int = default) throws
|
||||
public var path: String { get }
|
||||
public func checkpoint(kind: GRDB.CheckpointMode = default) throws
|
||||
public func releaseMemory()
|
||||
}
|
||||
|
||||
extension DatabasePool : DatabaseReader {
|
||||
public func read<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func nonIsolatedRead<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
@@ -453,13 +332,11 @@ extension DatabasePool : DatabaseReader {
|
||||
public func addCollation(collation: GRDB.DatabaseCollation)
|
||||
public func removeCollation(collation: GRDB.DatabaseCollation)
|
||||
}
|
||||
|
||||
extension DatabasePool : DatabaseWriter {
|
||||
public func write<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func writeInTransaction(kind: GRDB.TransactionKind? = default, _ block: (db: GRDB.Database) throws -> GRDB.TransactionCompletion) throws
|
||||
public func readFromWrite(block: (db: GRDB.Database) -> Void)
|
||||
}
|
||||
|
||||
final public class DatabaseQueue {
|
||||
public init(path: String, configuration: GRDB.Configuration = default) throws
|
||||
public init(configuration: GRDB.Configuration = default)
|
||||
@@ -469,7 +346,6 @@ final public class DatabaseQueue {
|
||||
public func inTransaction(kind: GRDB.TransactionKind? = default, _ block: (db: GRDB.Database) throws -> GRDB.TransactionCompletion) throws
|
||||
public func releaseMemory()
|
||||
}
|
||||
|
||||
extension DatabaseQueue : DatabaseReader {
|
||||
public func read<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func nonIsolatedRead<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
@@ -478,12 +354,10 @@ extension DatabaseQueue : DatabaseReader {
|
||||
public func addCollation(collation: GRDB.DatabaseCollation)
|
||||
public func removeCollation(collation: GRDB.DatabaseCollation)
|
||||
}
|
||||
|
||||
extension DatabaseQueue : DatabaseWriter {
|
||||
public func write<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func readFromWrite(block: (db: GRDB.Database) -> Void)
|
||||
}
|
||||
|
||||
public protocol DatabaseReader : class {
|
||||
public func read<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func nonIsolatedRead<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
@@ -492,12 +366,10 @@ public protocol DatabaseReader : class {
|
||||
public func addCollation(collation: GRDB.DatabaseCollation)
|
||||
public func removeCollation(collation: GRDB.DatabaseCollation)
|
||||
}
|
||||
|
||||
public struct DatabaseSequence<Element> : SequenceType {
|
||||
@warn_unused_result
|
||||
public func generate() -> GRDB.DatabaseGenerator<Element>
|
||||
}
|
||||
|
||||
public struct DatabaseValue {
|
||||
public enum Storage {
|
||||
case Null
|
||||
@@ -517,34 +389,27 @@ public struct DatabaseValue {
|
||||
@warn_unused_result
|
||||
public func failableValue<Value : DatabaseValueConvertible>() -> Value?
|
||||
}
|
||||
|
||||
extension DatabaseValue : Hashable {
|
||||
public var hashValue: Int { get }
|
||||
}
|
||||
|
||||
extension DatabaseValue : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> GRDB.DatabaseValue?
|
||||
}
|
||||
|
||||
extension DatabaseValue : StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
}
|
||||
|
||||
extension DatabaseValue : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
extension DatabaseValue {
|
||||
public init?(object: AnyObject)
|
||||
public func toAnyObject() -> AnyObject
|
||||
}
|
||||
|
||||
public protocol DatabaseValueConvertible : _SQLExpressionType {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -553,7 +418,6 @@ extension DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> Self?
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible where Self : StatementColumnConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -562,7 +426,6 @@ extension DatabaseValueConvertible where Self : StatementColumnConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> Self?
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch(statement: GRDB.SelectStatement, arguments: GRDB.StatementArguments? = default) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -577,11 +440,9 @@ extension DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> Self?
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible where Self : StatementColumnConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch(statement: GRDB.SelectStatement, arguments: GRDB.StatementArguments? = default) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -596,23 +457,19 @@ extension DatabaseValueConvertible where Self : StatementColumnConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> Self?
|
||||
}
|
||||
|
||||
public protocol DatabaseWriter : DatabaseReader {
|
||||
public func write<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func readFromWrite(block: (db: GRDB.Database) -> Void)
|
||||
}
|
||||
|
||||
extension DatabaseWriter {
|
||||
public func addTransactionObserver(transactionObserver: TransactionObserverType)
|
||||
public func removeTransactionObserver(transactionObserver: TransactionObserverType)
|
||||
}
|
||||
|
||||
public struct FetchRequest<T> {
|
||||
public init(tableName: String)
|
||||
@warn_unused_result
|
||||
public func selectStatement(database: GRDB.Database) throws -> GRDB.SelectStatement
|
||||
}
|
||||
|
||||
extension FetchRequest {
|
||||
@warn_unused_result
|
||||
public func select(selection: _SQLSelectable...) -> GRDB.FetchRequest<T>
|
||||
@@ -646,17 +503,14 @@ extension FetchRequest {
|
||||
@warn_unused_result
|
||||
public func limit(limit: Int, offset: Int? = default) -> GRDB.FetchRequest<T>
|
||||
}
|
||||
|
||||
extension FetchRequest {
|
||||
@warn_unused_result
|
||||
public func fetchCount(db: GRDB.Database) -> Int
|
||||
}
|
||||
|
||||
extension FetchRequest {
|
||||
public func contains(element: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
public var exists: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension FetchRequest where T : RowConvertible {
|
||||
@warn_unused_result
|
||||
public func fetch(db: GRDB.Database) -> GRDB.DatabaseSequence<T>
|
||||
@@ -665,9 +519,7 @@ extension FetchRequest where T : RowConvertible {
|
||||
@warn_unused_result
|
||||
public func fetchOne(db: GRDB.Database) -> T?
|
||||
}
|
||||
|
||||
public func LogSQL(sql: String)
|
||||
|
||||
public protocol MutablePersistable : TableMapping {
|
||||
public var persistentDictionary: [String : DatabaseValueConvertible?] { get }
|
||||
public mutating func didInsertWithRowID(rowID: Int64, forColumn column: String?)
|
||||
@@ -677,7 +529,6 @@ public protocol MutablePersistable : TableMapping {
|
||||
public func delete(db: GRDB.Database) throws -> Bool
|
||||
public func exists(db: GRDB.Database) -> Bool
|
||||
}
|
||||
|
||||
extension MutablePersistable {
|
||||
public mutating func didInsertWithRowID(rowID: Int64, forColumn column: String?)
|
||||
public mutating func insert(db: GRDB.Database) throws
|
||||
@@ -691,13 +542,11 @@ extension MutablePersistable {
|
||||
public func performDelete(db: GRDB.Database) throws -> Bool
|
||||
public func performExists(db: GRDB.Database) -> Bool
|
||||
}
|
||||
|
||||
public protocol Persistable : MutablePersistable {
|
||||
public func didInsertWithRowID(rowID: Int64, forColumn column: String?)
|
||||
public func insert(db: GRDB.Database) throws
|
||||
public func save(db: GRDB.Database) throws
|
||||
}
|
||||
|
||||
extension Persistable {
|
||||
public func didInsertWithRowID(rowID: Int64, forColumn column: String?)
|
||||
public func insert(db: GRDB.Database) throws
|
||||
@@ -705,15 +554,12 @@ extension Persistable {
|
||||
public func performInsert(db: GRDB.Database) throws
|
||||
public func performSave(db: GRDB.Database) throws
|
||||
}
|
||||
|
||||
public enum PersistenceError : ErrorType {
|
||||
case NotFound(MutablePersistable)
|
||||
}
|
||||
|
||||
extension PersistenceError : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public class Record : RowConvertible, TableMapping, Persistable {
|
||||
public init()
|
||||
required public init(_ row: GRDB.Row)
|
||||
@@ -730,18 +576,15 @@ public class Record : RowConvertible, TableMapping, Persistable {
|
||||
final public func save(db: GRDB.Database) throws
|
||||
public func delete(db: GRDB.Database) throws -> Bool
|
||||
}
|
||||
|
||||
extension Record : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
final public class Row {
|
||||
public init()
|
||||
public init(_ dictionary: [String : DatabaseValueConvertible?])
|
||||
@warn_unused_result
|
||||
public func copy() -> GRDB.Row
|
||||
}
|
||||
|
||||
extension Row {
|
||||
@warn_unused_result
|
||||
public class func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<GRDB.Row>
|
||||
@@ -750,17 +593,14 @@ extension Row {
|
||||
@warn_unused_result
|
||||
public class func fetchOne<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.Row?
|
||||
}
|
||||
|
||||
extension Row {
|
||||
public convenience init?(_ dictionary: NSDictionary)
|
||||
public func toNSDictionary() -> NSDictionary
|
||||
}
|
||||
|
||||
extension Row {
|
||||
public var columnNames: LazyMapCollection<GRDB.Row, String> { get }
|
||||
public func hasColumn(columnName: String) -> Bool
|
||||
}
|
||||
|
||||
extension Row {
|
||||
@warn_unused_result
|
||||
public func value(atIndex index: Int) -> DatabaseValueConvertible?
|
||||
@@ -791,12 +631,10 @@ extension Row {
|
||||
@warn_unused_result
|
||||
public func databaseValue(named columnName: String) -> GRDB.DatabaseValue
|
||||
}
|
||||
|
||||
extension Row {
|
||||
public subscript (columnName: String) -> GRDB.DatabaseValue? { get }
|
||||
public var databaseValues: LazyMapCollection<GRDB.Row, GRDB.DatabaseValue> { get }
|
||||
}
|
||||
|
||||
extension Row {
|
||||
@warn_unused_result
|
||||
public class func fetch(statement: GRDB.SelectStatement, arguments: GRDB.StatementArguments? = default) -> GRDB.DatabaseSequence<GRDB.Row>
|
||||
@@ -811,7 +649,6 @@ extension Row {
|
||||
@warn_unused_result
|
||||
public class func fetchOne(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> GRDB.Row?
|
||||
}
|
||||
|
||||
extension Row : CollectionType {
|
||||
public var count: Int { get }
|
||||
public func generate() -> IndexingGenerator<GRDB.Row>
|
||||
@@ -819,19 +656,15 @@ extension Row : CollectionType {
|
||||
public var endIndex: GRDB.RowIndex { get }
|
||||
public subscript (index: GRDB.RowIndex) -> (String, GRDB.DatabaseValue) { get }
|
||||
}
|
||||
|
||||
extension Row : Equatable {
|
||||
}
|
||||
|
||||
extension Row : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public protocol RowConvertible {
|
||||
public init(_ row: GRDB.Row)
|
||||
public mutating func awakeFromFetch(row row: GRDB.Row)
|
||||
}
|
||||
|
||||
extension RowConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -840,7 +673,6 @@ extension RowConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> Self?
|
||||
}
|
||||
|
||||
extension RowConvertible where Self : TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetch(db: GRDB.Database) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -849,7 +681,6 @@ extension RowConvertible where Self : TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database) -> Self?
|
||||
}
|
||||
|
||||
extension RowConvertible where Self : TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetch<Sequence : SequenceType where Sequence.Generator.Element : DatabaseValueConvertible>(db: GRDB.Database, keys: Sequence) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -864,7 +695,6 @@ extension RowConvertible where Self : TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database, key: [String : DatabaseValueConvertible?]) -> Self?
|
||||
}
|
||||
|
||||
extension RowConvertible {
|
||||
public func awakeFromFetch(row row: GRDB.Row)
|
||||
@warn_unused_result
|
||||
@@ -880,32 +710,25 @@ extension RowConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> Self?
|
||||
}
|
||||
|
||||
public struct RowIndex : ForwardIndexType, BidirectionalIndexType, RandomAccessIndexType {
|
||||
public func successor() -> GRDB.RowIndex
|
||||
public func predecessor() -> GRDB.RowIndex
|
||||
public func distanceTo(other: GRDB.RowIndex) -> Int
|
||||
public func advancedBy(n: Int) -> GRDB.RowIndex
|
||||
}
|
||||
|
||||
public struct SQLColumn {
|
||||
public let name: String
|
||||
public init(_ name: String)
|
||||
}
|
||||
|
||||
extension SQLColumn : _SQLDerivedExpressionType {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
public typealias SQLiteConnection = COpaquePointer
|
||||
|
||||
public typealias SQLiteStatement = COpaquePointer
|
||||
|
||||
final public class SelectStatement : GRDB.Statement {
|
||||
lazy public var columnCount: Int
|
||||
lazy public var columnNames: [String]
|
||||
}
|
||||
|
||||
public class Statement {
|
||||
public let sqliteStatement: GRDB.SQLiteStatement
|
||||
public let sql: String
|
||||
@@ -913,7 +736,6 @@ public class Statement {
|
||||
public func validateArguments(arguments: GRDB.StatementArguments) throws
|
||||
public func unsafeSetArguments(arguments: GRDB.StatementArguments)
|
||||
}
|
||||
|
||||
public struct StatementArguments {
|
||||
public var isEmpty: Bool { get }
|
||||
public init<Sequence : SequenceType where Sequence.Generator.Element == DatabaseValueConvertible?>(_ sequence: Sequence)
|
||||
@@ -921,32 +743,25 @@ public struct StatementArguments {
|
||||
public init<Sequence : SequenceType where Sequence.Generator.Element == (String, DatabaseValueConvertible?)>(_ sequence: Sequence)
|
||||
public init<Sequence : SequenceType, Value : DatabaseValueConvertible where Sequence.Generator.Element == (String, Value)>(_ sequence: Sequence)
|
||||
}
|
||||
|
||||
extension StatementArguments {
|
||||
public init?(_ array: NSArray)
|
||||
public init?(_ dictionary: NSDictionary)
|
||||
}
|
||||
|
||||
extension StatementArguments : ArrayLiteralConvertible {
|
||||
public init(arrayLiteral elements: DatabaseValueConvertible?...)
|
||||
}
|
||||
|
||||
extension StatementArguments : DictionaryLiteralConvertible {
|
||||
public init(dictionaryLiteral elements: (String, DatabaseValueConvertible?)...)
|
||||
}
|
||||
|
||||
extension StatementArguments : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public protocol StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
}
|
||||
|
||||
public protocol TableMapping {
|
||||
public static func databaseTableName() -> String
|
||||
}
|
||||
|
||||
extension TableMapping {
|
||||
@warn_unused_result
|
||||
public static func all() -> GRDB.FetchRequest<Self>
|
||||
@@ -969,87 +784,70 @@ extension TableMapping {
|
||||
@warn_unused_result
|
||||
public static func limit(limit: Int, offset: Int? = default) -> GRDB.FetchRequest<Self>
|
||||
}
|
||||
|
||||
extension TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetchCount(db: GRDB.Database) -> Int
|
||||
}
|
||||
|
||||
public typealias TraceFunction = (String) -> Void
|
||||
|
||||
public enum TransactionCompletion {
|
||||
case Commit
|
||||
case Rollback
|
||||
}
|
||||
|
||||
public enum TransactionKind {
|
||||
case Deferred
|
||||
case Immediate
|
||||
case Exclusive
|
||||
}
|
||||
|
||||
public protocol TransactionObserverType : class {
|
||||
public func databaseDidChangeWithEvent(event: GRDB.DatabaseEvent)
|
||||
public func databaseWillCommit() throws
|
||||
public func databaseDidCommit(db: GRDB.Database)
|
||||
public func databaseDidRollback(db: GRDB.Database)
|
||||
}
|
||||
|
||||
final public class UpdateStatement : GRDB.Statement {
|
||||
public func execute(arguments arguments: GRDB.StatementArguments? = default) throws -> GRDB.DatabaseChanges
|
||||
}
|
||||
|
||||
public struct _SQLCollatedExpression {
|
||||
}
|
||||
|
||||
extension _SQLCollatedExpression : _SQLExpressionType {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension _SQLCollatedExpression : _SQLSortDescriptorType {
|
||||
public var reversedSortDescriptor: GRDB._SQLSortDescriptor { get }
|
||||
public var asc: GRDB._SQLSortDescriptor { get }
|
||||
public var desc: GRDB._SQLSortDescriptor { get }
|
||||
public func orderingSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
}
|
||||
|
||||
public protocol _SQLDerivedExpressionType : _SQLExpressionType, _SQLSortDescriptorType, _SQLSelectable {
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public func collating(collationName: String) -> GRDB._SQLCollatedExpression
|
||||
public func collating(collation: GRDB.DatabaseCollation) -> GRDB._SQLCollatedExpression
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public var capitalizedString: GRDB._SQLExpression { get }
|
||||
public var lowercaseString: GRDB._SQLExpression { get }
|
||||
public var uppercaseString: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public var localizedCapitalizedString: GRDB._SQLExpression { get }
|
||||
public var localizedLowercaseString: GRDB._SQLExpression { get }
|
||||
public var localizedUppercaseString: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public var reversedSortDescriptor: GRDB._SQLSortDescriptor { get }
|
||||
public func orderingSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public func resultColumnSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
public func countedSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
public var sqlSelectableKind: GRDB._SQLSelectableKind { get }
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public var asc: GRDB._SQLSortDescriptor { get }
|
||||
public var desc: GRDB._SQLSortDescriptor { get }
|
||||
public func aliased(alias: String) -> _SQLSelectable
|
||||
}
|
||||
|
||||
indirect public enum _SQLExpression {
|
||||
case Literal(String)
|
||||
case Value(DatabaseValueConvertible?)
|
||||
@@ -1070,63 +868,43 @@ indirect public enum _SQLExpression {
|
||||
case Count(_SQLSelectable)
|
||||
case CountDistinct(GRDB._SQLExpression)
|
||||
}
|
||||
|
||||
extension _SQLExpression : _SQLDerivedExpressionType {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
public protocol _SQLExpressionType {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
public struct _SQLSelectQuery {
|
||||
}
|
||||
|
||||
public protocol _SQLSelectable {
|
||||
public func resultColumnSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
public func countedSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
public var sqlSelectableKind: GRDB._SQLSelectableKind { get }
|
||||
}
|
||||
|
||||
public enum _SQLSelectableKind {
|
||||
case Expression(GRDB._SQLExpression)
|
||||
case Star(sourceName: String?)
|
||||
}
|
||||
|
||||
public enum _SQLSortDescriptor {
|
||||
case Asc(GRDB._SQLExpression)
|
||||
case Desc(GRDB._SQLExpression)
|
||||
}
|
||||
|
||||
extension _SQLSortDescriptor : _SQLSortDescriptorType {
|
||||
public var reversedSortDescriptor: GRDB._SQLSortDescriptor { get }
|
||||
public func orderingSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
}
|
||||
|
||||
public protocol _SQLSortDescriptorType {
|
||||
public var reversedSortDescriptor: GRDB._SQLSortDescriptor { get }
|
||||
public func orderingSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
}
|
||||
|
||||
public func abs(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func average(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func count(distinct value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func count(counted: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func databaseQuestionMarks(count count: Int) -> String
|
||||
|
||||
public func max(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func min(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func sum(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ||(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ||(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ||(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
@@ -5,50 +5,41 @@ import GRDB
|
||||
import GRDB.Swift
|
||||
import SQLiteiPhoneSimulator
|
||||
import UIKit
|
||||
|
||||
public var GRDB_VersionNumber: Double
|
||||
extension Double : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Double?
|
||||
}
|
||||
|
||||
extension NSString : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension NSURL : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension Int32 : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Int32?
|
||||
}
|
||||
|
||||
extension Range where Element : protocol<_SQLExpressionType, BidirectionalIndexType> {
|
||||
public func contains(element: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension Int : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Int?
|
||||
}
|
||||
|
||||
extension NSNull : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension RawRepresentable where Self : DatabaseValueConvertible, Self.RawValue : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension Optional where Wrapped : DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch(statement: GRDB.SelectStatement, arguments: GRDB.StatementArguments? = default) -> GRDB.DatabaseSequence<Wrapped?>
|
||||
@@ -59,237 +50,149 @@ extension Optional where Wrapped : DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchAll(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> [Wrapped?]
|
||||
}
|
||||
|
||||
extension Optional where Wrapped : DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<Wrapped?>
|
||||
@warn_unused_result
|
||||
public static func fetchAll<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> [Wrapped?]
|
||||
}
|
||||
|
||||
extension NSDate : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension NSData : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension String : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> String?
|
||||
}
|
||||
|
||||
extension String {
|
||||
public var quotedDatabaseIdentifier: String { get }
|
||||
}
|
||||
|
||||
extension Int64 : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Int64?
|
||||
}
|
||||
|
||||
extension HalfOpenInterval where Bound : _SQLExpressionType {
|
||||
public func contains(element: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension HalfOpenInterval where Bound : _SQLExpressionType {
|
||||
public func contains(element: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension CGFloat : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> CGFloat?
|
||||
}
|
||||
|
||||
extension ClosedInterval where Bound : _SQLExpressionType {
|
||||
public func contains(element: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension ClosedInterval where Bound : _SQLExpressionType {
|
||||
public func contains(element: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension Bool : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Bool?
|
||||
}
|
||||
|
||||
extension NSNumber : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public class func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension SequenceType where Self.Generator.Element : _SQLExpressionType {
|
||||
public func contains(element: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension SequenceType where Self.Generator.Element : _SQLExpressionType {
|
||||
public func contains(element: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension Float : DatabaseValueConvertible, StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Float?
|
||||
}
|
||||
|
||||
prefix public func !(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: protocol<_SQLExpressionType, BooleanType>?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLDerivedExpressionType, rhs: protocol<_SQLExpressionType, BooleanType>?) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: _SQLExpressionType?, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func !=(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func !==(lhs: _SQLExpressionType?, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func &&(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func &&(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func &&(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func *(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func *(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func *(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func +(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func +(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func +(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
prefix public func -(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func -(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func -(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func -(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func /(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func /(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func /(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: _SQLExpressionType, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: _SQLExpressionType, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func <=(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: protocol<_SQLExpressionType, BooleanType>?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB.Row, rhs: GRDB.Row) -> Bool
|
||||
|
||||
public func ==(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB.RowIndex, rhs: GRDB.RowIndex) -> Bool
|
||||
|
||||
public func ==(lhs: GRDB.DatabaseValue, rhs: GRDB.DatabaseValue) -> Bool
|
||||
|
||||
public func ==(lhs: _SQLExpressionType?, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB.DatabaseFunction, rhs: GRDB.DatabaseFunction) -> Bool
|
||||
|
||||
public func ==(lhs: _SQLDerivedExpressionType, rhs: protocol<_SQLExpressionType, BooleanType>?) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func ==(lhs: GRDB.DatabaseCollation, rhs: GRDB.DatabaseCollation) -> Bool
|
||||
|
||||
public func ===(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: _SQLExpressionType?, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType?) -> GRDB._SQLExpression
|
||||
|
||||
public func ===(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: _SQLExpressionType, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: GRDB._SQLCollatedExpression, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: _SQLExpressionType, rhs: GRDB._SQLCollatedExpression) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func >=(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ??(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ??(lhs: _SQLExpressionType?, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public typealias BusyCallback = (numberOfTries: Int) -> Bool
|
||||
|
||||
public enum BusyMode {
|
||||
case ImmediateError
|
||||
case Timeout(NSTimeInterval)
|
||||
case Callback(GRDB.BusyCallback)
|
||||
}
|
||||
|
||||
public enum CheckpointMode : Int32 {
|
||||
case Passive
|
||||
case Full
|
||||
case Restart
|
||||
case Truncate
|
||||
}
|
||||
|
||||
public struct Configuration {
|
||||
public var foreignKeysEnabled: Bool
|
||||
public var readonly: Bool
|
||||
@@ -299,12 +202,10 @@ public struct Configuration {
|
||||
public var busyMode: GRDB.BusyMode
|
||||
public init()
|
||||
}
|
||||
|
||||
final public class Database {
|
||||
public let configuration: GRDB.Configuration
|
||||
public let sqliteConnection: GRDB.SQLiteConnection
|
||||
}
|
||||
|
||||
extension Database {
|
||||
@warn_unused_result
|
||||
public func selectStatement(sql: String) throws -> GRDB.SelectStatement
|
||||
@@ -312,49 +213,40 @@ extension Database {
|
||||
public func updateStatement(sql: String) throws -> GRDB.UpdateStatement
|
||||
public func execute(sql: String, arguments: GRDB.StatementArguments? = default) throws -> GRDB.DatabaseChanges
|
||||
}
|
||||
|
||||
extension Database {
|
||||
public func addFunction(function: GRDB.DatabaseFunction)
|
||||
public func removeFunction(function: GRDB.DatabaseFunction)
|
||||
}
|
||||
|
||||
extension Database {
|
||||
public func addCollation(collation: GRDB.DatabaseCollation)
|
||||
public func removeCollation(collation: GRDB.DatabaseCollation)
|
||||
}
|
||||
|
||||
extension Database {
|
||||
public func clearSchemaCache()
|
||||
public func tableExists(tableName: String) -> Bool
|
||||
}
|
||||
|
||||
extension Database {
|
||||
public func inTransaction(kind: GRDB.TransactionKind? = default, @noescape _ block: () throws -> GRDB.TransactionCompletion) throws
|
||||
public func addTransactionObserver(transactionObserver: TransactionObserverType)
|
||||
public func removeTransactionObserver(transactionObserver: TransactionObserverType)
|
||||
}
|
||||
|
||||
public struct DatabaseChanges {
|
||||
public let changedRowCount: Int
|
||||
public let insertedRowID: Int64?
|
||||
}
|
||||
|
||||
public struct DatabaseCoder : DatabaseValueConvertible {
|
||||
public let object: AnyObject
|
||||
public init?(_ object: AnyObject?)
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> GRDB.DatabaseCoder?
|
||||
}
|
||||
|
||||
final public class DatabaseCollation {
|
||||
public let name: String
|
||||
public init(_ name: String, function: (String, String) -> NSComparisonResult)
|
||||
}
|
||||
|
||||
extension DatabaseCollation : Hashable {
|
||||
public var hashValue: Int { get }
|
||||
}
|
||||
|
||||
extension DatabaseCollation {
|
||||
public class let unicodeCompare: GRDB.DatabaseCollation
|
||||
public class let caseInsensitiveCompare: GRDB.DatabaseCollation
|
||||
@@ -362,7 +254,6 @@ extension DatabaseCollation {
|
||||
public class let localizedCompare: GRDB.DatabaseCollation
|
||||
public class let localizedStandardCompare: GRDB.DatabaseCollation
|
||||
}
|
||||
|
||||
public struct DatabaseDateComponents : DatabaseValueConvertible {
|
||||
public enum Format : String {
|
||||
case YMD
|
||||
@@ -379,18 +270,15 @@ public struct DatabaseDateComponents : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> GRDB.DatabaseDateComponents?
|
||||
}
|
||||
|
||||
public struct DatabaseError : ErrorType {
|
||||
public let code: Int32
|
||||
public let message: String?
|
||||
public let sql: String?
|
||||
public init(code: Int32 = default, message: String? = default, sql: String? = default, arguments: GRDB.StatementArguments? = default)
|
||||
}
|
||||
|
||||
extension DatabaseError : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public struct DatabaseEvent {
|
||||
public enum Kind : Int32 {
|
||||
case Insert
|
||||
@@ -402,43 +290,35 @@ public struct DatabaseEvent {
|
||||
public var tableName: String { get }
|
||||
public let rowID: Int64
|
||||
}
|
||||
|
||||
final public class DatabaseFunction {
|
||||
public let name: String
|
||||
public init(_ name: String, argumentCount: Int32? = default, pure: Bool = default, function: [GRDB.DatabaseValue] throws -> DatabaseValueConvertible?)
|
||||
}
|
||||
|
||||
extension DatabaseFunction : Hashable {
|
||||
public var hashValue: Int { get }
|
||||
}
|
||||
|
||||
extension DatabaseFunction {
|
||||
public func apply(arguments: _SQLExpressionType...) -> GRDB._SQLExpression
|
||||
}
|
||||
|
||||
extension DatabaseFunction {
|
||||
public class let capitalizedString: GRDB.DatabaseFunction
|
||||
public class let lowercaseString: GRDB.DatabaseFunction
|
||||
public class let uppercaseString: GRDB.DatabaseFunction
|
||||
}
|
||||
|
||||
extension DatabaseFunction {
|
||||
public class let localizedCapitalizedString: GRDB.DatabaseFunction
|
||||
public class let localizedLowercaseString: GRDB.DatabaseFunction
|
||||
public class let localizedUppercaseString: GRDB.DatabaseFunction
|
||||
}
|
||||
|
||||
public class DatabaseGenerator<Element> : GeneratorType {
|
||||
@warn_unused_result
|
||||
public func next() -> Element?
|
||||
}
|
||||
|
||||
public struct DatabaseMigrator {
|
||||
public init()
|
||||
public mutating func registerMigration(identifier: String, withDisabledForeignKeyChecks disabledForeignKeyChecks: Bool = default, migrate: (GRDB.Database) throws -> Void)
|
||||
public func migrate(db: DatabaseWriter) throws
|
||||
}
|
||||
|
||||
final public class DatabasePool {
|
||||
public init(path: String, configuration: GRDB.Configuration = default, maximumReaderCount: Int = default) throws
|
||||
public var path: String { get }
|
||||
@@ -446,7 +326,6 @@ final public class DatabasePool {
|
||||
public func releaseMemory()
|
||||
public func setupMemoryManagement(application application: UIApplication)
|
||||
}
|
||||
|
||||
extension DatabasePool : DatabaseReader {
|
||||
public func read<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func nonIsolatedRead<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
@@ -455,13 +334,11 @@ extension DatabasePool : DatabaseReader {
|
||||
public func addCollation(collation: GRDB.DatabaseCollation)
|
||||
public func removeCollation(collation: GRDB.DatabaseCollation)
|
||||
}
|
||||
|
||||
extension DatabasePool : DatabaseWriter {
|
||||
public func write<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func writeInTransaction(kind: GRDB.TransactionKind? = default, _ block: (db: GRDB.Database) throws -> GRDB.TransactionCompletion) throws
|
||||
public func readFromWrite(block: (db: GRDB.Database) -> Void)
|
||||
}
|
||||
|
||||
final public class DatabaseQueue {
|
||||
public init(path: String, configuration: GRDB.Configuration = default) throws
|
||||
public init(configuration: GRDB.Configuration = default)
|
||||
@@ -472,7 +349,6 @@ final public class DatabaseQueue {
|
||||
public func releaseMemory()
|
||||
public func setupMemoryManagement(application application: UIApplication)
|
||||
}
|
||||
|
||||
extension DatabaseQueue : DatabaseReader {
|
||||
public func read<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func nonIsolatedRead<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
@@ -481,12 +357,10 @@ extension DatabaseQueue : DatabaseReader {
|
||||
public func addCollation(collation: GRDB.DatabaseCollation)
|
||||
public func removeCollation(collation: GRDB.DatabaseCollation)
|
||||
}
|
||||
|
||||
extension DatabaseQueue : DatabaseWriter {
|
||||
public func write<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func readFromWrite(block: (db: GRDB.Database) -> Void)
|
||||
}
|
||||
|
||||
public protocol DatabaseReader : class {
|
||||
public func read<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func nonIsolatedRead<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
@@ -495,12 +369,10 @@ public protocol DatabaseReader : class {
|
||||
public func addCollation(collation: GRDB.DatabaseCollation)
|
||||
public func removeCollation(collation: GRDB.DatabaseCollation)
|
||||
}
|
||||
|
||||
public struct DatabaseSequence<Element> : SequenceType {
|
||||
@warn_unused_result
|
||||
public func generate() -> GRDB.DatabaseGenerator<Element>
|
||||
}
|
||||
|
||||
public struct DatabaseValue {
|
||||
public enum Storage {
|
||||
case Null
|
||||
@@ -520,34 +392,27 @@ public struct DatabaseValue {
|
||||
@warn_unused_result
|
||||
public func failableValue<Value : DatabaseValueConvertible>() -> Value?
|
||||
}
|
||||
|
||||
extension DatabaseValue {
|
||||
public init?(object: AnyObject)
|
||||
public func toAnyObject() -> AnyObject
|
||||
}
|
||||
|
||||
extension DatabaseValue : Hashable {
|
||||
public var hashValue: Int { get }
|
||||
}
|
||||
|
||||
extension DatabaseValue : DatabaseValueConvertible {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> GRDB.DatabaseValue?
|
||||
}
|
||||
|
||||
extension DatabaseValue : StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
}
|
||||
|
||||
extension DatabaseValue : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public protocol DatabaseValueConvertible : _SQLExpressionType {
|
||||
public var databaseValue: GRDB.DatabaseValue { get }
|
||||
public static func fromDatabaseValue(databaseValue: GRDB.DatabaseValue) -> Self?
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -556,7 +421,6 @@ extension DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> Self?
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible where Self : StatementColumnConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -565,7 +429,6 @@ extension DatabaseValueConvertible where Self : StatementColumnConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> Self?
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch(statement: GRDB.SelectStatement, arguments: GRDB.StatementArguments? = default) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -580,11 +443,9 @@ extension DatabaseValueConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> Self?
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension DatabaseValueConvertible where Self : StatementColumnConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch(statement: GRDB.SelectStatement, arguments: GRDB.StatementArguments? = default) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -599,23 +460,19 @@ extension DatabaseValueConvertible where Self : StatementColumnConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> Self?
|
||||
}
|
||||
|
||||
public protocol DatabaseWriter : DatabaseReader {
|
||||
public func write<T>(block: (db: GRDB.Database) throws -> T) rethrows -> T
|
||||
public func readFromWrite(block: (db: GRDB.Database) -> Void)
|
||||
}
|
||||
|
||||
extension DatabaseWriter {
|
||||
public func addTransactionObserver(transactionObserver: TransactionObserverType)
|
||||
public func removeTransactionObserver(transactionObserver: TransactionObserverType)
|
||||
}
|
||||
|
||||
public struct FetchRequest<T> {
|
||||
public init(tableName: String)
|
||||
@warn_unused_result
|
||||
public func selectStatement(database: GRDB.Database) throws -> GRDB.SelectStatement
|
||||
}
|
||||
|
||||
extension FetchRequest {
|
||||
@warn_unused_result
|
||||
public func select(selection: _SQLSelectable...) -> GRDB.FetchRequest<T>
|
||||
@@ -649,17 +506,14 @@ extension FetchRequest {
|
||||
@warn_unused_result
|
||||
public func limit(limit: Int, offset: Int? = default) -> GRDB.FetchRequest<T>
|
||||
}
|
||||
|
||||
extension FetchRequest {
|
||||
@warn_unused_result
|
||||
public func fetchCount(db: GRDB.Database) -> Int
|
||||
}
|
||||
|
||||
extension FetchRequest {
|
||||
public func contains(element: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
public var exists: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension FetchRequest where T : RowConvertible {
|
||||
@warn_unused_result
|
||||
public func fetch(db: GRDB.Database) -> GRDB.DatabaseSequence<T>
|
||||
@@ -668,7 +522,6 @@ extension FetchRequest where T : RowConvertible {
|
||||
@warn_unused_result
|
||||
public func fetchOne(db: GRDB.Database) -> T?
|
||||
}
|
||||
|
||||
final public class FetchedRecordsController<Record : RowConvertible> {
|
||||
public convenience init(_ databaseWriter: DatabaseWriter, sql: String, arguments: GRDB.StatementArguments? = default, queue: dispatch_queue_t = default, isSameRecord: ((Record, Record) -> Bool)? = default)
|
||||
public convenience init<T>(_ databaseWriter: DatabaseWriter, request: GRDB.FetchRequest<T>, queue: dispatch_queue_t = default, isSameRecord: ((Record, Record) -> Bool)? = default)
|
||||
@@ -683,42 +536,34 @@ final public class FetchedRecordsController<Record : RowConvertible> {
|
||||
public func indexPathForRecord(record: Record) -> NSIndexPath?
|
||||
public var sections: [GRDB.FetchedRecordsSectionInfo<Record>] { get }
|
||||
}
|
||||
|
||||
extension FetchedRecordsController where Record : MutablePersistable {
|
||||
public convenience init(_ databaseWriter: DatabaseWriter, sql: String, arguments: GRDB.StatementArguments? = default, queue: dispatch_queue_t = default, compareRecordsByPrimaryKey: Bool)
|
||||
public convenience init<U>(_ databaseWriter: DatabaseWriter, request: GRDB.FetchRequest<U>, queue: dispatch_queue_t = default, compareRecordsByPrimaryKey: Bool)
|
||||
}
|
||||
|
||||
public protocol FetchedRecordsControllerDelegate : class {
|
||||
public func controllerWillChangeRecords<T>(controller: GRDB.FetchedRecordsController<T>)
|
||||
public func controller<T>(controller: GRDB.FetchedRecordsController<T>, didChangeRecord record: T, withEvent event: GRDB.FetchedRecordsEvent)
|
||||
public func controllerDidChangeRecords<T>(controller: GRDB.FetchedRecordsController<T>)
|
||||
}
|
||||
|
||||
extension FetchedRecordsControllerDelegate {
|
||||
public func controllerWillChangeRecords<T>(controller: GRDB.FetchedRecordsController<T>)
|
||||
public func controller<T>(controller: GRDB.FetchedRecordsController<T>, didChangeRecord record: T, withEvent event: GRDB.FetchedRecordsEvent)
|
||||
public func controllerDidChangeRecords<T>(controller: GRDB.FetchedRecordsController<T>)
|
||||
}
|
||||
|
||||
public enum FetchedRecordsEvent {
|
||||
case Insertion(indexPath: NSIndexPath)
|
||||
case Deletion(indexPath: NSIndexPath)
|
||||
case Move(indexPath: NSIndexPath, newIndexPath: NSIndexPath, changes: [String : GRDB.DatabaseValue])
|
||||
case Update(indexPath: NSIndexPath, changes: [String : GRDB.DatabaseValue])
|
||||
}
|
||||
|
||||
extension FetchedRecordsEvent : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public struct FetchedRecordsSectionInfo<T : RowConvertible> {
|
||||
public var numberOfRecords: Int { get }
|
||||
public var records: [T] { get }
|
||||
}
|
||||
|
||||
public func LogSQL(sql: String)
|
||||
|
||||
public protocol MutablePersistable : TableMapping {
|
||||
public var persistentDictionary: [String : DatabaseValueConvertible?] { get }
|
||||
public mutating func didInsertWithRowID(rowID: Int64, forColumn column: String?)
|
||||
@@ -728,7 +573,6 @@ public protocol MutablePersistable : TableMapping {
|
||||
public func delete(db: GRDB.Database) throws -> Bool
|
||||
public func exists(db: GRDB.Database) -> Bool
|
||||
}
|
||||
|
||||
extension MutablePersistable {
|
||||
public mutating func didInsertWithRowID(rowID: Int64, forColumn column: String?)
|
||||
public mutating func insert(db: GRDB.Database) throws
|
||||
@@ -742,13 +586,11 @@ extension MutablePersistable {
|
||||
public func performDelete(db: GRDB.Database) throws -> Bool
|
||||
public func performExists(db: GRDB.Database) -> Bool
|
||||
}
|
||||
|
||||
public protocol Persistable : MutablePersistable {
|
||||
public func didInsertWithRowID(rowID: Int64, forColumn column: String?)
|
||||
public func insert(db: GRDB.Database) throws
|
||||
public func save(db: GRDB.Database) throws
|
||||
}
|
||||
|
||||
extension Persistable {
|
||||
public func didInsertWithRowID(rowID: Int64, forColumn column: String?)
|
||||
public func insert(db: GRDB.Database) throws
|
||||
@@ -756,15 +598,12 @@ extension Persistable {
|
||||
public func performInsert(db: GRDB.Database) throws
|
||||
public func performSave(db: GRDB.Database) throws
|
||||
}
|
||||
|
||||
public enum PersistenceError : ErrorType {
|
||||
case NotFound(MutablePersistable)
|
||||
}
|
||||
|
||||
extension PersistenceError : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public class Record : RowConvertible, TableMapping, Persistable {
|
||||
public init()
|
||||
required public init(_ row: GRDB.Row)
|
||||
@@ -781,18 +620,15 @@ public class Record : RowConvertible, TableMapping, Persistable {
|
||||
final public func save(db: GRDB.Database) throws
|
||||
public func delete(db: GRDB.Database) throws -> Bool
|
||||
}
|
||||
|
||||
extension Record : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
final public class Row {
|
||||
public init()
|
||||
public init(_ dictionary: [String : DatabaseValueConvertible?])
|
||||
@warn_unused_result
|
||||
public func copy() -> GRDB.Row
|
||||
}
|
||||
|
||||
extension Row {
|
||||
@warn_unused_result
|
||||
public class func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<GRDB.Row>
|
||||
@@ -801,17 +637,14 @@ extension Row {
|
||||
@warn_unused_result
|
||||
public class func fetchOne<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.Row?
|
||||
}
|
||||
|
||||
extension Row {
|
||||
public convenience init?(_ dictionary: NSDictionary)
|
||||
public func toNSDictionary() -> NSDictionary
|
||||
}
|
||||
|
||||
extension Row {
|
||||
public var columnNames: LazyMapCollection<GRDB.Row, String> { get }
|
||||
public func hasColumn(columnName: String) -> Bool
|
||||
}
|
||||
|
||||
extension Row {
|
||||
@warn_unused_result
|
||||
public func value(atIndex index: Int) -> DatabaseValueConvertible?
|
||||
@@ -842,12 +675,10 @@ extension Row {
|
||||
@warn_unused_result
|
||||
public func databaseValue(named columnName: String) -> GRDB.DatabaseValue
|
||||
}
|
||||
|
||||
extension Row {
|
||||
public subscript (columnName: String) -> GRDB.DatabaseValue? { get }
|
||||
public var databaseValues: LazyMapCollection<GRDB.Row, GRDB.DatabaseValue> { get }
|
||||
}
|
||||
|
||||
extension Row {
|
||||
@warn_unused_result
|
||||
public class func fetch(statement: GRDB.SelectStatement, arguments: GRDB.StatementArguments? = default) -> GRDB.DatabaseSequence<GRDB.Row>
|
||||
@@ -862,7 +693,6 @@ extension Row {
|
||||
@warn_unused_result
|
||||
public class func fetchOne(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> GRDB.Row?
|
||||
}
|
||||
|
||||
extension Row : CollectionType {
|
||||
public var count: Int { get }
|
||||
public func generate() -> IndexingGenerator<GRDB.Row>
|
||||
@@ -870,19 +700,15 @@ extension Row : CollectionType {
|
||||
public var endIndex: GRDB.RowIndex { get }
|
||||
public subscript (index: GRDB.RowIndex) -> (String, GRDB.DatabaseValue) { get }
|
||||
}
|
||||
|
||||
extension Row : Equatable {
|
||||
}
|
||||
|
||||
extension Row : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public protocol RowConvertible {
|
||||
public init(_ row: GRDB.Row)
|
||||
public mutating func awakeFromFetch(row row: GRDB.Row)
|
||||
}
|
||||
|
||||
extension RowConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetch<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -891,7 +717,6 @@ extension RowConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne<T>(db: GRDB.Database, _ request: GRDB.FetchRequest<T>) -> Self?
|
||||
}
|
||||
|
||||
extension RowConvertible where Self : TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetch(db: GRDB.Database) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -900,7 +725,6 @@ extension RowConvertible where Self : TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database) -> Self?
|
||||
}
|
||||
|
||||
extension RowConvertible where Self : TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetch<Sequence : SequenceType where Sequence.Generator.Element : DatabaseValueConvertible>(db: GRDB.Database, keys: Sequence) -> GRDB.DatabaseSequence<Self>
|
||||
@@ -915,7 +739,6 @@ extension RowConvertible where Self : TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database, key: [String : DatabaseValueConvertible?]) -> Self?
|
||||
}
|
||||
|
||||
extension RowConvertible {
|
||||
public func awakeFromFetch(row row: GRDB.Row)
|
||||
@warn_unused_result
|
||||
@@ -931,32 +754,25 @@ extension RowConvertible {
|
||||
@warn_unused_result
|
||||
public static func fetchOne(db: GRDB.Database, _ sql: String, arguments: GRDB.StatementArguments? = default) -> Self?
|
||||
}
|
||||
|
||||
public struct RowIndex : ForwardIndexType, BidirectionalIndexType, RandomAccessIndexType {
|
||||
public func successor() -> GRDB.RowIndex
|
||||
public func predecessor() -> GRDB.RowIndex
|
||||
public func distanceTo(other: GRDB.RowIndex) -> Int
|
||||
public func advancedBy(n: Int) -> GRDB.RowIndex
|
||||
}
|
||||
|
||||
public struct SQLColumn {
|
||||
public let name: String
|
||||
public init(_ name: String)
|
||||
}
|
||||
|
||||
extension SQLColumn : _SQLDerivedExpressionType {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
public typealias SQLiteConnection = COpaquePointer
|
||||
|
||||
public typealias SQLiteStatement = COpaquePointer
|
||||
|
||||
final public class SelectStatement : GRDB.Statement {
|
||||
lazy public var columnCount: Int
|
||||
lazy public var columnNames: [String]
|
||||
}
|
||||
|
||||
public class Statement {
|
||||
public let sqliteStatement: GRDB.SQLiteStatement
|
||||
public let sql: String
|
||||
@@ -964,7 +780,6 @@ public class Statement {
|
||||
public func validateArguments(arguments: GRDB.StatementArguments) throws
|
||||
public func unsafeSetArguments(arguments: GRDB.StatementArguments)
|
||||
}
|
||||
|
||||
public struct StatementArguments {
|
||||
public var isEmpty: Bool { get }
|
||||
public init<Sequence : SequenceType where Sequence.Generator.Element == DatabaseValueConvertible?>(_ sequence: Sequence)
|
||||
@@ -972,32 +787,25 @@ public struct StatementArguments {
|
||||
public init<Sequence : SequenceType where Sequence.Generator.Element == (String, DatabaseValueConvertible?)>(_ sequence: Sequence)
|
||||
public init<Sequence : SequenceType, Value : DatabaseValueConvertible where Sequence.Generator.Element == (String, Value)>(_ sequence: Sequence)
|
||||
}
|
||||
|
||||
extension StatementArguments {
|
||||
public init?(_ array: NSArray)
|
||||
public init?(_ dictionary: NSDictionary)
|
||||
}
|
||||
|
||||
extension StatementArguments : ArrayLiteralConvertible {
|
||||
public init(arrayLiteral elements: DatabaseValueConvertible?...)
|
||||
}
|
||||
|
||||
extension StatementArguments : DictionaryLiteralConvertible {
|
||||
public init(dictionaryLiteral elements: (String, DatabaseValueConvertible?)...)
|
||||
}
|
||||
|
||||
extension StatementArguments : CustomStringConvertible {
|
||||
public var description: String { get }
|
||||
}
|
||||
|
||||
public protocol StatementColumnConvertible {
|
||||
public init(sqliteStatement: GRDB.SQLiteStatement, index: Int32)
|
||||
}
|
||||
|
||||
public protocol TableMapping {
|
||||
public static func databaseTableName() -> String
|
||||
}
|
||||
|
||||
extension TableMapping {
|
||||
@warn_unused_result
|
||||
public static func all() -> GRDB.FetchRequest<Self>
|
||||
@@ -1020,87 +828,70 @@ extension TableMapping {
|
||||
@warn_unused_result
|
||||
public static func limit(limit: Int, offset: Int? = default) -> GRDB.FetchRequest<Self>
|
||||
}
|
||||
|
||||
extension TableMapping {
|
||||
@warn_unused_result
|
||||
public static func fetchCount(db: GRDB.Database) -> Int
|
||||
}
|
||||
|
||||
public typealias TraceFunction = (String) -> Void
|
||||
|
||||
public enum TransactionCompletion {
|
||||
case Commit
|
||||
case Rollback
|
||||
}
|
||||
|
||||
public enum TransactionKind {
|
||||
case Deferred
|
||||
case Immediate
|
||||
case Exclusive
|
||||
}
|
||||
|
||||
public protocol TransactionObserverType : class {
|
||||
public func databaseDidChangeWithEvent(event: GRDB.DatabaseEvent)
|
||||
public func databaseWillCommit() throws
|
||||
public func databaseDidCommit(db: GRDB.Database)
|
||||
public func databaseDidRollback(db: GRDB.Database)
|
||||
}
|
||||
|
||||
final public class UpdateStatement : GRDB.Statement {
|
||||
public func execute(arguments arguments: GRDB.StatementArguments? = default) throws -> GRDB.DatabaseChanges
|
||||
}
|
||||
|
||||
public struct _SQLCollatedExpression {
|
||||
}
|
||||
|
||||
extension _SQLCollatedExpression : _SQLExpressionType {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension _SQLCollatedExpression : _SQLSortDescriptorType {
|
||||
public var reversedSortDescriptor: GRDB._SQLSortDescriptor { get }
|
||||
public var asc: GRDB._SQLSortDescriptor { get }
|
||||
public var desc: GRDB._SQLSortDescriptor { get }
|
||||
public func orderingSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
}
|
||||
|
||||
public protocol _SQLDerivedExpressionType : _SQLExpressionType, _SQLSortDescriptorType, _SQLSelectable {
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public func collating(collationName: String) -> GRDB._SQLCollatedExpression
|
||||
public func collating(collation: GRDB.DatabaseCollation) -> GRDB._SQLCollatedExpression
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public var capitalizedString: GRDB._SQLExpression { get }
|
||||
public var lowercaseString: GRDB._SQLExpression { get }
|
||||
public var uppercaseString: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public var localizedCapitalizedString: GRDB._SQLExpression { get }
|
||||
public var localizedLowercaseString: GRDB._SQLExpression { get }
|
||||
public var localizedUppercaseString: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public var reversedSortDescriptor: GRDB._SQLSortDescriptor { get }
|
||||
public func orderingSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public func resultColumnSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
public func countedSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
public var sqlSelectableKind: GRDB._SQLSelectableKind { get }
|
||||
}
|
||||
|
||||
extension _SQLDerivedExpressionType {
|
||||
public var asc: GRDB._SQLSortDescriptor { get }
|
||||
public var desc: GRDB._SQLSortDescriptor { get }
|
||||
public func aliased(alias: String) -> _SQLSelectable
|
||||
}
|
||||
|
||||
indirect public enum _SQLExpression {
|
||||
case Literal(String)
|
||||
case Value(DatabaseValueConvertible?)
|
||||
@@ -1121,63 +912,43 @@ indirect public enum _SQLExpression {
|
||||
case Count(_SQLSelectable)
|
||||
case CountDistinct(GRDB._SQLExpression)
|
||||
}
|
||||
|
||||
extension _SQLExpression : _SQLDerivedExpressionType {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
public protocol _SQLExpressionType {
|
||||
public var sqlExpression: GRDB._SQLExpression { get }
|
||||
}
|
||||
|
||||
public struct _SQLSelectQuery {
|
||||
}
|
||||
|
||||
public protocol _SQLSelectable {
|
||||
public func resultColumnSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
public func countedSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
public var sqlSelectableKind: GRDB._SQLSelectableKind { get }
|
||||
}
|
||||
|
||||
public enum _SQLSelectableKind {
|
||||
case Expression(GRDB._SQLExpression)
|
||||
case Star(sourceName: String?)
|
||||
}
|
||||
|
||||
public enum _SQLSortDescriptor {
|
||||
case Asc(GRDB._SQLExpression)
|
||||
case Desc(GRDB._SQLExpression)
|
||||
}
|
||||
|
||||
extension _SQLSortDescriptor : _SQLSortDescriptorType {
|
||||
public var reversedSortDescriptor: GRDB._SQLSortDescriptor { get }
|
||||
public func orderingSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
}
|
||||
|
||||
public protocol _SQLSortDescriptorType {
|
||||
public var reversedSortDescriptor: GRDB._SQLSortDescriptor { get }
|
||||
public func orderingSQL(db: GRDB.Database, inout _ bindings: [DatabaseValueConvertible?]) throws -> String
|
||||
}
|
||||
|
||||
public func abs(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func average(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func count(distinct value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func count(counted: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func databaseQuestionMarks(count count: Int) -> String
|
||||
|
||||
public func max(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func min(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func sum(value: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ||(lhs: _SQLExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ||(lhs: _SQLDerivedExpressionType, rhs: _SQLDerivedExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
public func ||(lhs: _SQLDerivedExpressionType, rhs: _SQLExpressionType) -> GRDB._SQLExpression
|
||||
|
||||
Reference in new issue
Block a user