toValue - multiple declarations

Function toValue

Converts Nullable!T to Value

Value toValue(T) (
  T v
)
if (is(T == Nullable!R, R) && !isArrayType!(typeof(v.get)) && !isGeometricType!(typeof(v.get)));

Value toValue(T) (
  T v
)
if (is(T == Nullable!R, R) && isArrayType!(typeof(v.get)));

Value toValue(T) (
  T v
)
if (is(T == Nullable!R, R) && isGeometricType!(typeof(v.get)));

Function toValue

Value toValue(T) (
  T v
)
if (isNumeric!T);

Function toValue

Convert money.currency to PG value

Value toValue(T) (
  T v
)
if (isInstanceOf!(currency, T) && (T.amount.sizeof == 8));

Caution

here is no check of fractional precision while conversion! See also: PostgreSQL's "lc_monetary" description and "money" package description

Function toValue

Convert std.bitmanip.BitArray to PG value

Value toValue(T) (
  T v
) @trusted
if (is(Unqual!T == BitArray));

Function toValue

Converts types implicitly convertible to string to PG Value. Note that if string is null it is written as an empty string. If NULL is a desired DB value, Nullable!string can be used instead.

Value toValue(T) (
  T v,
  ValueFormat valueFormat = ValueFormat.BINARY
) @trusted
if (isSomeString!T || isStaticArrayString!T);

Function toValue

Constructs Value from array of bytes

Value toValue(T) (
  T v
)
if (is(T : immutable(ubyte)[]));

Function toValue

Constructs Value from boolean

Value toValue(T) (
  T v
) @trusted
if (!is(T == Nullable!R, R));

Function toValue

Constructs Value from Date

Value toValue(T) (
  T v
)
if (is(Unqual!T == Date));

Function toValue

Constructs Value from TimeOfDay

Value toValue(T) (
  T v
)
if (is(Unqual!T == TimeOfDay));

Value toValue(T) (
  T v
)
if (is(Unqual!T == TimeOfDayWithTZ));

Function toValue

Constructs Value from Interval

Value toValue(T) (
  T v
)
if (is(Unqual!T == Interval));

Function toValue

Constructs Value from TimeStamp or from TimeStampUTC

Value toValue(T) (
  T v
)
if (is(Unqual!T == TimeStamp) || is(Unqual!T == TimeStampUTC));

Function toValue

Constructs Value from DateTime It uses Timestamp without TZ as a resulting PG type

Value toValue(T) (
  T v
)
if (is(Unqual!T == DateTime));

Function toValue

Constructs Value from SysTime Note that SysTime has a precision in hnsecs and PG TimeStamp in usecs. It means that PG value will have 10 times lower precision. And as both types are using long for internal storage it also means that PG TimeStamp can store greater range of values than SysTime.

Value toValue(T) (
  T v
)
if (is(Unqual!T == SysTime));

Function toValue

Constructs Value from UUID

Value toValue(T) (
  T v
)
if (is(Unqual!T == UUID));

Function toValue

Constructs Value from Json

Value toValue(T) (
  T v
)
if (is(Unqual!T == Json));