跳到主要内容

sqlTimestampLiteral()

function sqlTimestampLiteral(value): string;

Defined in: packages/rxdb/src/system/sql-literal.ts:116

把时刻拼成 SQL 字符串字面量(ISO 8601,UTC)。

Parameters​

ParameterTypeDescription
valueDate时刻

Returns​

string

ISO 8601 字符串字面量

Remarks​

与两边的日期列存储形态一致:PGlite 的 timestamptz 接受 ISO 文本的赋值转换, SQLite 家族本就把 PropertyType.date 存成 ISO TEXT。

Throws​

RxDBError 值是 Invalid Date 时——它会拼出 'Invalid Date' 这个字符串, 在 SQLite 上安静落库,在 PGlite 上要到执行时才炸