Skip to main content

Module to_sql

Module to_sql 

Source
Expand description

Trait for converting Rust types to SQL values.

Structs§

Binary
A fixed-length binary(length) parameter for an Always Encrypted column (see binary).
Char
A fixed-length char(length) parameter for an Always Encrypted column (see char()).
DateTime2
A datetime2(scale) parameter for an Always Encrypted column (see datetime2).
DateTimeLegacy
A legacy datetime parameter for an Always Encrypted column (see datetime).
DateTimeOffset
A datetimeoffset(scale) parameter for an Always Encrypted column (see datetimeoffset).
NChar
A fixed-length nchar(length) parameter for an Always Encrypted column (see nchar).
Numeric
A decimal/numeric parameter with explicit precision and scale.
Time
A time(scale) parameter for an Always Encrypted column (see time).
TypedNull
A typed NULL parameter, created with null.

Enums§

EncryptedParamType
The explicit SQL type for an Always Encrypted parameter whose value cannot convey it (see numeric, time, datetime2, datetimeoffset, datetime). Carries the precision/scale/length the encrypted column requires the declared parameter type to match exactly.

Traits§

SqlTyped
Associates a Rust type with its SQL type name so a typed NULL can be declared without a value (see null).
ToSql
Trait for types that can be converted to SQL values.

Functions§

binary
Create a binary(length) parameter for an Always Encrypted binary column.
char
Create a char(length) parameter for an Always Encrypted char column.
datetime
Create a legacy datetime parameter for an Always Encrypted datetime column. A plain NaiveDateTime defaults to datetime2, which an encrypted legacy datetime column rejects; this declares datetime explicitly.
datetime2
Create a datetime2(scale) parameter for an Always Encrypted datetime2 column. A plain NaiveDateTime defaults to datetime2(7), so an explicit scale is required to match a column with a different scale (and to encrypt at the right byte length). scale is the fractional-second digits (0–7).
datetimeoffset
Create a datetimeoffset(scale) parameter for an Always Encrypted datetimeoffset column. scale is the fractional-second digits (0–7).
nchar
Create an nchar(length) parameter for an Always Encrypted nchar column.
null
Create a typed NULL parameter for SQL type T, e.g. null::<i32>().
numeric
Create a decimal/numeric parameter with explicit precision and scale.
time
Create a time(scale) parameter for an Always Encrypted time column.