InsertInterface

public protocol InsertInterface

Convenient interface for inserting

  • Execute inserting with TableEncodable object on specific(or all) properties

    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 insert<Object: TableEncodable>(

    Parameters

    objects

    Table encodable object

    propertyConvertibleList

    Property or CodingTableKey list

    table

    Table name

  • Execute inserting with TableEncodable object on specific(or all) properties

    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 insert<Object: TableEncodable>(

    Parameters

    objects

    Table encodable object

    propertyConvertibleList

    Property or CodingTableKey list

    table

    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 or CodingTableKey list

    table

    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 or CodingTableKey list

    table

    Table name