Index

RBORMCenter.swift

Enumerations

Protocols

Classes


RBORMCenter

Centrally manages SQLite databases and ORM objects. - Manages multiple SQLite databases. - Creates tables. - Manages RBORMObjects, and provides CRUD support. - Runs SQL queries directly.

Properties

The default database identifier
static public let defaultDatabaseIdentifier String { get set }

The shared singleton RBORMCenter.
static public let shared RBORMCenter { get set }

Functions

Registers an object to receive notifications whenever an interaction occurs with a managed database.
@param receiver : The observer that should receive notification events.
@returns Returns YES if registration was succesful.
public func registerDatabaseNotificationReceiver(_ receiver: RBORMDatabaseObserver) -> Bool

Detaches an existing database observer from receiving event notifications.
@param receiver : The observer that should no longer receive notifications.
public func deregisterDatabaseNotificationReceiver(_ receiver: RBORMObjectObserver)

Registers an object to receive notifications whenever an interaction occurs with a managed object.
@param receiver : The observer that should receive notification events.
@returns Returns YES if registration was succesful.
public func registerObjectNotificationReceiver(_ receiver: RBORMObjectObserver) -> Bool

Detaches an existing object observer from receiving event notifications.
@param receiver : The observer that should no longer receive notifications.
public func deregisterObjectNotificationReceiver(_ receiver: RBORMObjectObserver)

open func databaseConnection(_ databaseConnection: RBSQLiteConnection, willAttachWithIdentifier identifier: String)

open func databaseConnection(_ databaseConnection: RBSQLiteConnection, didAttachWithIdentifier identifier: String, operationWasSuccessful: Bool)

open func databaseConnection(_ databaseConnection: RBSQLiteConnection, willDetachWithIdentifier identifier: String)

open func databaseConnection(_ databaseConnection: RBSQLiteConnection, didDetachWithIdentifier identifier: String)

open func databaseConnection(_ databaseConnection: RBSQLiteConnection, withIdentifier identifier: String, willExecute query: String, bindings: [Any]?)

open func databaseConnection(_ databaseConnection: RBSQLiteConnection, withIdentifier identifier: String, operationWasSuccessful: Bool, result: RBSQLiteResult?)

open func object(_ object: RBORMObject, willInsertWithIdentifier identifier: String)

open func object(_ object: RBORMObject, willUpdateWithIdentifier identifier: String)

open func object(_ object: RBORMObject, didInsertWithIdentifier identifier: String, operationWasSuccessful: Bool, result: RBSQLiteResult?)

open func object(_ object: RBORMObject, didUpdateWithIdentifier identifier: String, operationWasSuccessful: Bool, result: RBSQLiteResult?)

open func object(_ object: RBORMObject, willDeleteWithIdentifier identifier: String)

open func object(_ object: RBORMObject, didDeleteWithIdentifier identifier: String, operationWasSuccessful: Bool, result: RBSQLiteResult?)

Attaches a RBSQLiteConnection connection for management by the RBORMCenter.
@param databaseConnection : The database connection to manage.
@param databaseIdentifier : An identifier which will be used to reference this specific database connection.
@returns Returns YES if the RBSQLiteConnection was successfully attached.
public func attachDatabaseConnection(_ databaseConnection: RBSQLiteConnection, databaseIdentifier: String = RBORMCenter.defaultDatabaseIdentifier) -> Bool

Detaches an existing RBSQLiteConnection database connection.
@param databaseIdentifier : The database identifier reference for the database connection to detach.
@returns Returns the detached RBSQLiteConnection connection or nil.
public func detachDatabaseConnection(databaseIdentifier: String = RBORMCenter.defaultDatabaseIdentifier) -> RBSQLiteConnection?

Returns the RBSQLiteConnection database connection that corresponds to the specified identifier.
@param identifier : The database identifier.
@returns Returns the RBSQLiteConnection database connection or nil.
public func databaseConnection(forIdentifier identifier: String = RBORMCenter.defaultDatabaseIdentifier) -> RBSQLiteConnection?