Currently, in the Node.js binding, the Databend timestamp type is mapped to Node.js's Date type, which leads to two critical issues:
- Node.js's
Date type cannot retain timezone information, while Databend’s timestamp type relies on the timezone configuration in the server settings. This results in the permanent loss of timezone context during the mapping process.
- The
timestamp_tz type (timestamp with timezone) is designed to explicitly carry timezone information, so the current Node.js binding returns it as a formatted string
Proposal:
Adjust the Node.js binding to map the Databend timestamp type (without timezone) to a string type (consistent with how timestamp_tz is currently returned), rather than the Node.js Date type. This change will:
- Prevent the loss of timezone configuration information associated with the original
timestamp value (derived from Databend’s timezone setting).
- Align the return type consistency of
timestamp and timestamp_tz in the Node.js binding, making the API more predictable for developers.