Node.js Firebird Driver now supports Firebird 4 data types

Posted on in firebird, nodejs, javascript, typescript

node-firebird-driver-native version 2.2.0 has been released supporting Firebird 4 data types.

INT128, DECFLOAT(16) and DECFLOAT(34) are represented as strings.

TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE are both represented with types ZonedDate and ZonedDateEx.

/** TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE to be sent as parameter */
export interface ZonedDate {
	date: Date;
	timeZone: string;
}

/** TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE returned by Firebird */
export interface ZonedDateEx extends ZonedDate {
	offset: number;
}

ZonedDate should be used when sending data to Firebird. The date field should have a JavaScript Date object set in UTC.

ZonedDateEx is returned by Firebird. In addition to ZonedDate fields, it has the offset (set in minutes) that when added to the date field makes it a local date in the given timeZone. It works as Firebird native ISC_TIME_TZ_EX and ISC_TIMESTAMP_TZ_EX.