Skip to content

Function: consumeBinary() ​

Call Signature ​

ts
function consumeBinary(
  key: string,
  value: unknown,
  nullable: true,
): LucidBinaryValue | null;

Consumes a binary value from database results with nullable support

Parameters ​

ParameterTypeDescription
keystringThe field name for error reporting
valueunknownThe value to consume
nullabletrueWhether the field can be null

Returns ​

| LucidBinaryValue | null

The consumed LucidBinaryValue or null if nullable and value is null

Throws ​

E_INVALID_CONSUMED_VALUE when the value cannot be consumed

Call Signature ​

ts
function consumeBinary(
  key: string,
  value: unknown,
  nullable?: false,
): LucidBinaryValue;

Consumes a binary value from database results with nullable support

Parameters ​

ParameterTypeDescription
keystringThe field name for error reporting
valueunknownThe value to consume
nullable?falseWhether the field can be null

Returns ​

LucidBinaryValue

The consumed LucidBinaryValue or null if nullable and value is null

Throws ​

E_INVALID_CONSUMED_VALUE when the value cannot be consumed