bendsql
bendsql copied to clipboard
[Node.js Binding] Databend Timestamp type mapping to string with timezone instead of Date
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
Datetype cannot retain timezone information, while Databend’stimestamptype relies on thetimezoneconfiguration in the server settings. This results in the permanent loss of timezone context during the mapping process. - The
timestamp_tztype (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
timestampvalue (derived from Databend’stimezonesetting). - Align the return type consistency of
timestampandtimestamp_tzin the Node.js binding, making the API more predictable for developers.