Skip to content

Function: prepareBinary()

Call Signature

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

Prepares a binary value for database storage with nullable support

Parameters

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

Returns

| LucidBinaryValue | null

The prepared binary value or null if nullable and value is null

Throws

E_INVALID_PREPARED_VALUE when the value cannot be prepared

Call Signature

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

Prepares a binary value for database storage with nullable support

Parameters

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

Returns

LucidBinaryValue

The prepared binary value or null if nullable and value is null

Throws

E_INVALID_PREPARED_VALUE when the value cannot be prepared