Skip to main content

Module types

Module types 

Source
Expand description

Type conversion between tokio-postgres values and oxisql_core types.

Supported Postgres types -> OxiSQL Value mapping:

Postgres OID groupOxiSQL variant
BOOLValue::Bool
INT2, INT4Value::I64 (widened)
INT8Value::I64
FLOAT4Value::F64 (widened)
FLOAT8Value::F64
TEXT, VARCHAR, BPCHAR, NAMEValue::Text
BYTEAValue::Blob
DATEValue::Date (days since Unix epoch 1970-01-01)
TIMESTAMPValue::Timestamp (microseconds since Unix epoch, no tz)
TIMESTAMPTZValue::Timestamp (microseconds since Unix epoch, UTC)
TIMEValue::Time (microseconds since midnight)
UUIDValue::Uuid (u128 big-endian)
JSON, JSONBValue::Json
NUMERICValue::Decimal (exact decimal string)
BOOL[] / INT2[] / INT4[] / INT8[] / FLOAT4[] / FLOAT8[] / TEXT[] / VARCHAR[]Value::TypedArray
TIMESTAMPTZ[] / TIMESTAMP[] / DATE[] / TIME[] / UUID[] / BYTEA[] / JSON[] / JSONB[]Value::TypedArray
INTERVALValue::Text (HH:MM:SS or “N months N days HH:MM:SS”)
NULL (any)Value::Null
everything elseValue::Text via type-name marker

Enums§

OwnedParam
Owned SQL parameter that implements ToSql.

Functions§

pg_row_to_row
Convert a tokio_postgres PgRow into an oxisql_core Row.
value_to_param
Convert an oxisql_core::Value to an OwnedParam.