Row.peek

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).

Parameters

T

The type of the returned data. T must be a boolean, a built-in numeric type, a string, an array or a Variant.

Return Value

Type: T

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 TRequested database type
isIntegral!T || isBoolean!TINTEGER, via sqlite3_column_int64
isFloatingPoint!TFLOAT, via sqlite3_column_double
isSomeString!TTEXT, via sqlite3_column_text
isArray!TBLOB, via sqlite3_column_blob
is(T == Nullable!U)NULL or T
Other typesCompilation 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.

Meta