Table
public final class Table<Root: TableCodable>: CoreRepresentable
Convenient table interface
-
The tag of the related database.
Declaration
Swift
public var tag: Tag? -
The path of the related database.
Declaration
Swift
public var path: String -
Table name
Declaration
Swift
public let name: String -
Table related type
Declaration
Swift
public var rootType: Root.Type
-
Execute inserting with
TableCodableobject 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
ErrorDeclaration
Swift
public func insert(objects: [Object], on propertyConvertibleList: [PropertyConvertible]? = nil) throwsParameters
objectsTable encodable object
propertyConvertibleListPropertyorCodingTableKeylist -
Execute inserting or replacing with
TableCodableobject 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
ErrorDeclaration
Swift
public func insertOrReplace(objects: [Object], on propertyConvertibleList: [PropertyConvertible]? = nil) throwsParameters
objectsTable encodable object
propertyConvertibleListPropertyorCodingTableKeylist -
Execute inserting with
TableCodableobject 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
ErrorDeclaration
Swift
public func insert(objects: Object..., on propertyConvertibleList: [PropertyConvertible]? = nil) throwsParameters
objectsTable encodable object
propertyConvertibleListPropertyorCodingTableKeylist -
Execute inserting or replacing with
TableCodableobject 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
ErrorDeclaration
Swift
public func insertOrReplace(objects: Object..., on propertyConvertibleList: [PropertyConvertible]? = nil) throwsParameters
objectsTable encodable object
propertyConvertibleListPropertyorCodingTableKeylist
-
Execute updating with
TableCodableobject on specific(or all) properties.Throws
ErrorDeclaration
Swift
public func update(on propertyConvertibleList: [PropertyConvertible], with object: Object, where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throwsParameters
propertyConvertibleListPropertyorCodingTableKeylistobjectTable encodable object
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
-
Execute updating with
TableCodableobject on specific(or all) properties.Throws
ErrorDeclaration
Swift
public func update(on propertyConvertibleList: PropertyConvertible..., with object: Object, where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throwsParameters
propertyConvertibleListPropertyorCodingTableKeylistobjectTable encodable object
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
-
Execute updating with row on specific(or all) properties.
Throws
ErrorDeclaration
Swift
public func update(on propertyConvertibleList: PropertyConvertible..., with row: [ColumnEncodableBase], where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throwsParameters
propertyConvertibleListPropertyorCodingTableKeylistobjectTable encodable object
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
-
Execute updating with row on specific(or all) properties.
Throws
ErrorDeclaration
Swift
public func update(on propertyConvertibleList: [PropertyConvertible], with row: [ColumnEncodableBase], where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throwsParameters
propertyConvertibleListPropertyorCodingTableKeylistobjectTable encodable object
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
-
Execute deleting
Throws
ErrorDeclaration
Swift
public func delete(where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throwsParameters
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
-
Get objects on specific(or all) properties
Throws
ErrorDeclaration
Swift
public func getObjects(on propertyConvertibleList: [PropertyConvertible], where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throws -> [Object]Parameters
propertyConvertibleListPropertyorCodingTableKeylistconditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
Return Value
Table decodable objects
-
Get objects on specific(or all) properties
Throws
ErrorDeclaration
Swift
public func getObjects(on propertyConvertibleList: PropertyConvertible..., where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throws -> [Object]Parameters
propertyConvertibleListPropertyorCodingTableKeylistconditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
Return Value
Table decodable objects
-
Get object on specific(or all) properties
Throws
ErrorDeclaration
Swift
public func getObject(on propertyConvertibleList: [PropertyConvertible], where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, offset: Offset? = nil) throws -> Object?Parameters
propertyConvertibleListPropertyorCodingTableKeylistconditionExpression convertible
orderListExpression convertible list
offsetExpression convertible
Return Value
Table decodable objects
-
Get object on specific(or all) properties
Throws
ErrorDeclaration
Swift
public func getObject(on propertyConvertibleList: PropertyConvertible..., where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, offset: Offset? = nil) throws -> Object?Parameters
propertyConvertibleListPropertyorCodingTableKeylistconditionExpression convertible
orderListExpression convertible list
offsetExpression convertible
Return Value
Table decodable objects
-
Get rows by specific selecting
Throws
ErrorDeclaration
Swift
public func getRows(on columnResultConvertibleList: [ColumnResultConvertible], where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throws -> FundamentalRowXColumnParameters
columnResultConvertibleListWINQ column result list
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
Return Value
FundamentalRowXColumn -
Get rows by specific selecting
Throws
ErrorDeclaration
Swift
public func getRows(on columnResultConvertibleList: ColumnResultConvertible..., where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throws -> FundamentalRowXColumnParameters
columnResultConvertibleListWINQ column result list
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
Return Value
FundamentalRowXColumn -
Get row by specific selecting
Throws
ErrorDeclaration
Swift
public func getRow(on columnResultConvertibleList: ColumnResultConvertible..., where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, offset: Offset? = nil) throws -> FundamentalRowParameters
columnResultConvertibleListWINQ column result list
conditionExpression convertible
orderListExpression convertible list
offsetExpression convertible
Return Value
FundamentalRowXColumn -
Get row by specific selecting
Throws
ErrorDeclaration
Swift
public func getRow(on columnResultConvertibleList: [ColumnResultConvertible], where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, offset: Offset? = nil) throws -> FundamentalRowParameters
columnResultConvertibleListWINQ column result list
conditionExpression convertible
orderListExpression convertible list
offsetExpression convertible
Return Value
FundamentalRowXColumn -
Get column by specific selecting
Throws
ErrorDeclaration
Swift
public func getColumn(on result: ColumnResultConvertible, where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throws -> FundamentalColumnParameters
columnResultConvertibleWINQ column result
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
Return Value
FundamentalColumn -
Get distinct column by specific selecting
Throws
ErrorDeclaration
Swift
public func getDistinctColumn(on result: ColumnResultConvertible, where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throws -> FundamentalColumnParameters
columnResultConvertibleWINQ column result
conditionExpression convertible
orderListExpression convertible list
limitExpression convertible
offsetExpression convertible
Return Value
FundamentalColumn -
Get value by specific selecting
Throws
ErrorDeclaration
Swift
public func getValue(on result: ColumnResultConvertible, where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throws -> FundamentalValueParameters
columnResultConvertibleWINQ column result
conditionExpression convertible
orderListExpression convertible list
offsetExpression convertible
Return Value
FundamentalValue -
Get distinct value by specific selecting
Throws
ErrorDeclaration
Swift
public func getDistinctValue(on result: ColumnResultConvertible, where condition: Condition? = nil, orderBy orderList: [OrderBy]? = nil, limit: Limit? = nil, offset: Offset? = nil) throws -> FundamentalValueParameters
columnResultConvertibleWINQ column result
conditionExpression convertible
orderListExpression convertible list
offsetExpression convertible
Return Value
FundamentalValue
View on GitHub
Install in Dash
Table Class Reference