Safer timestamp API
An optional time unit parameter can be passed to timestamp-accepting methods:
const bday = Date.parse('1856-07-10');
sender
.table('inventors')
.symbol('born', 'Austrian Empire')
.timestampColumn('birthday', bday, 'ms') // notice 'ms' here
.intColumn('id', 0)
.stringColumn('name', 'Nicola Tesla')
.at(Date.now(), 'ms'); // notice 'ms' here
The time unit defaults to 'us' (native QuestDB resolution) in both timestampColumn()
and at()
.
Supported values are:
- 'ns' - nanoseconds
- 'us' - microseconds
- 'ms' - milliseconds
Note: This release contains a breaking change.
at()
does not accept string
type anymore, and number
/BigInt
values are interpreted as microseconds instead of nanoseconds.