InsertInterface
public protocol InsertInterface
Convenient interface for inserting
-
Execute inserting with
TableEncodable
object on specific(or all) propertiesNote that it will run embedded transaction while objects.count>1.
The embedded transaction means that it will run a transaction if it’s not in other transaction, otherwise it will be executed within the existing transaction.Throws
Error
Declaration
Swift
func insert<Object: TableEncodable>(
Parameters
objects
Table encodable object
propertyConvertibleList
Property
orCodingTableKey
listtable
Table name
-
Execute inserting with
TableEncodable
object on specific(or all) propertiesNote that it will run embedded transaction while objects.count>1.
The embedded transaction means that it will run a transaction if it’s not in other transaction, otherwise it will be executed within the existing transaction.Throws
Error
Declaration
Swift
func insert<Object: TableEncodable>(
Parameters
objects
Table encodable object
propertyConvertibleList
Property
orCodingTableKey
listtable
Table name
-
Execute inserting or replacing with
TableEncodable
object on specific(or all) properties.
It will replace the original row while they have same primary key or row id.Note that it will run embedded transaction while objects.count>1.
The embedded transaction means that it will run a transaction if it’s not in other transaction, otherwise it will be executed within the existing transaction.Throws
Error
Declaration
Swift
func insertOrReplace<Object: TableEncodable>(
Parameters
objects
Table encodable object
propertyConvertibleList
Property
orCodingTableKey
listtable
Table name
-
Execute inserting or replacing with
TableEncodable
object on specific(or all) properties.
It will replace the original row while they have same primary key or row id.Note that it will run embedded transaction while objects.count>1.
The embedded transaction means that it will run a transaction if it’s not in other transaction, otherwise it will be executed within the existing transaction.Throws
Error
Declaration
Swift
func insertOrReplace<Object: TableEncodable>(
Parameters
objects
Table encodable object
propertyConvertibleList
Property
orCodingTableKey
listtable
Table name