Skip to content

SQLiteSettable

Jeff Hurray edited this page May 3, 2016 · 3 revisions

##Overview SQLiteSettable facilitates the transfer of data from the model layer to the database and cache layer.

##Setters

####Basic Value Setters Sets a value to the cache layer. Will be written to the database if the instance is saved. O(1) time.

func set<V: Value>(column: Expression<V>, value: V)
func set<V: Value>(column: Expression<V?>, value: V?)

####Relationship Setters Sets relationship. Executed on current thread. Automatically saved to the database.

func set<V: SQLiteModel>(column: Relationship<V>, value: V)
func set<V: SQLiteModel>(column: Relationship<V?>, value: V?)
func set<V: SQLiteModel>(column: Relationship<[V]>, value: [V])

####Background Relationship Setters Sets relationship. Executed on background thread. Automatically saved to the database.

func setInBackground<V: SQLiteModel>(column: Relationship<V>, value: V, completion: (Void -> Void)?)
func setInBackground<V: SQLiteModel>(column: Relationship<V?>, value: V?, completion: (Void -> Void)?)
func setInBackground<V: SQLiteModel>(column: Relationship<[V]>, value: [V], completion: (Void -> Void)?)

public protocol SQLiteSettable {
    func set<V: Value>(column: Expression<V>, value: V)
    func set<V: Value>(column: Expression<V?>, value: V?)
    
    func set<V: SQLiteModel>(column: Relationship<V>, value: V)
    func set<V: SQLiteModel>(column: Relationship<V?>, value: V?)
    func set<V: SQLiteModel>(column: Relationship<[V]>, value: [V])
    
    func setInBackground<V: SQLiteModel>(column: Relationship<V>, value: V, completion: (Void -> Void)?)
    func setInBackground<V: SQLiteModel>(column: Relationship<V?>, value: V?, completion: (Void -> Void)?)
    func setInBackground<V: SQLiteModel>(column: Relationship<[V]>, value: [V], completion: (Void -> Void)?)
}

Clone this wiki locally