The type of the returned data. T must be a boolean, a built-in numeric type, a string, an array or a Variant.
The index of the column in the prepared statement or the name of the column, as specified in the prepared statement with an AS clause.
A value of type T. The returned value is T.init if the data type is NULL. In all other cases, the data is fetched from SQLite (which returns a value depending on its own conversion rules; see http://www.sqlite.org/c3ref/column_blob.html and http://www.sqlite.org/lang_expr.html#castexpr), and it is converted to T using std.conv.to!T.
Condition on T | Requested database type |
---|---|
isIntegral!T || isBoolean!T | INTEGER, via sqlite3_column_int64 |
isFloatingPoint!T | FLOAT, via sqlite3_column_double |
isSomeString!T | TEXT, via sqlite3_column_text |
isArray!T | BLOB, via sqlite3_column_blob |
is(T == Nullable!U) | NULL or T |
Other types | Compilation error |
Warnings: The result is undefined if then index is out of range.
If the second overload is used, the names of all the columns are tested each time this function is called: use numeric indexing for better performance.
Returns the data of a column.
Contrary to opIndex, the peek functions return the data directly, automatically cast to T, without the overhead of using a wrapped Variant (ColumnData).