bendsql icon indicating copy to clipboard operation
bendsql copied to clipboard

[Node.js Binding] Databend Timestamp type mapping to string with timezone instead of Date

Open youngsofun opened this issue 1 month ago • 0 comments

Currently, in the Node.js binding, the Databend timestamp type is mapped to Node.js's Date type, which leads to two critical issues:

  1. 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.
  2. 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.

youngsofun avatar Nov 19 '25 09:11 youngsofun