value<T> function

Expr<T> value<T>(
  1. T value,
  2. Codec<T> codec
)

Creates a bound SQL value using an explicit storage codec.

Encoding happens now. Byte storage is copied into a read-only snapshot; subsequent changes to the source buffer do not change this expression. Other custom codec storage objects remain caller-owned.

Implementation

Expr<T> value<T>(T value, Codec<T> codec) => Expr.internal(
  ParameterNode(codec.encode(value), sqlType: codec.sqlType),
  codec,
);