CoreStatement
public final class CoreStatement: CoreRepresentable
CoreStatement for preparing or executing WINQ sql.
-
The tag of the related database.
Declaration
Swift
public var tag: Tag?
-
The path of the related database.
Declaration
Swift
public var path: String
-
The wrapper of
sqlite3_bind_*
for binding property of object to index.Throws
Error
Declaration
Swift
public func bind<TableEncodableType: TableEncodable>( _ propertyConvertible: PropertyConvertible, of object: TableEncodableType, toIndex index: Int = 1) throws
Parameters
propertyConvertible
Property
orCodingTableKey
object
Table encodable object
index
Begin with 1
-
The wrapper of
sqlite3_bind_*
for binding properties of object to indexes.Throws
Begin with 1Declaration
Swift
public func bind<TableEncodableType: TableEncodable>( _ indexedPropertyConvertibleList: [(_: PropertyConvertible, toIndex: Int)], of object: TableEncodableType) throws
Parameters
indexedPropertyConvertibleList
Indexed
Property
orCodingTableKey
listobject
Table encodable object
-
The wrapper of
sqlite3_bind_*
for binding properties of object.Throws
Begin with 1Declaration
Swift
public func bind<TableEncodableType: TableEncodable>( _ propertyConvertibleList: [PropertyConvertible], of object: TableEncodableType) throws
Parameters
propertyConvertibleList
Property
orCodingTableKey
listobject
Table encodable object
-
The wrapper of
sqlite3_bind_*
for binding column encodable object.Declaration
Swift
public func bind(_ value: ColumnEncodableBase?, toIndex index: Int)
Parameters
value
Column encodable object
index
Begin with 1
-
The wrapper of
sqlite3_column_*
for getting column decodable value.Declaration
Swift
public func value(atIndex index: Int, of type: ColumnDecodableBase.Type) -> ColumnDecodableBase?
Parameters
index
Begin with 0
type
Type of column codable object
Return Value
Same as type
-
The wrapper of
sqlite3_column_*
for getting column decodable value.Declaration
Swift
public func value<ColumnDecodableType: ColumnDecodable>( atIndex index: Int, of type: ColumnDecodableType.Type = ColumnDecodableType.self) -> ColumnDecodableType?
Parameters
index
Begin with 0
type
Type of column codable object
Return Value
Same as type
-
The wrapper of
sqlite3_column_*
for getting fundamentable value.Declaration
Swift
public func value(atIndex index: Int) -> FundamentalValue
Parameters
index
Begin with 0
Return Value
Int32
,Int64
,Double
,String
,Data
ornil
value. -
The wrapper of
sqlite3_column_*
for getting column decodable value.Declaration
Swift
public func value<ColumnDecodableType: ColumnDecodable>( byName name: String, of type: ColumnDecodableType.Type = ColumnDecodableType.self) -> ColumnDecodableType?
Parameters
name
Name of the column
type
Type of column codable object
Return Value
Same as type. Nil will be returned if no such a column.
-
Get index by column name.
Declaration
Swift
public func index(byName name: String) -> Int?
Parameters
name
Name of the column
Return Value
Index of given column name. Nil will be returned if no such a column.
-
The wrapper of
sqlite3_step
Throws
Error
Declaration
Swift
public func step() throws -> Bool
Return Value
True means you can continue stepping while false means the stepping has been completed.
-
The wrapper of
sqlite3_reset
Throws
Error
Declaration
Swift
public func reset() throws
-
The wrapper of
sqlite3_column_type
Declaration
Swift
public func columnType(atIndex index: Int) -> ColumnType
Parameters
index
Begin with 0
Return Value
Type of the column
-
The wrapper of
sqlite3_column_type
Declaration
Swift
public func columnType(byName name: String) -> ColumnType
Parameters
name
Name of the column
Return Value
Column type. For a non-exists column,
.null
will be returned. -
The wrapper of
sqlite3_column_count
.Declaration
Swift
public func columnCount() -> Int
Return Value
Count of column result
-
The wrapper of
sqlite3_column_name
.Declaration
Swift
public func columnName(atIndex index: Int) -> String
Parameters
index
Begin with 0
Return Value
Column name
-
The wrapper of
sqlite3_column_table_name
.Declaration
Swift
public func columnTableName(atIndex index: Int) -> String
Parameters
index
Begin with 0
Return Value
The related table of column at index
-
The wrapper of
sqlite3_finalize
Throws
Error
Declaration
Swift
public func finalize() throws
-
The number of changed rows in the most recent call.
It should be called after executing successfullyDeclaration
Swift
public var changes: Int
-
The row id of most recent insertion.
Declaration
Swift
public var lastInsertedRowID: Int64