Skip to content

Function: prepareBigint() ​

Call Signature ​

ts
function prepareBigint(
  key: string,
  value: unknown,
  nullable: true,
): bigint | null;

Prepares a bigint 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 ​

bigint | null

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

Throws ​

E_INVALID_PREPARED_VALUE when the value cannot be prepared

Call Signature ​

ts
function prepareBigint(key: string, value: unknown, nullable?: false): bigint;

Prepares a bigint 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 ​

bigint

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

Throws ​

E_INVALID_PREPARED_VALUE when the value cannot be prepared