Skip to content

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

@youngsofun

Description

@youngsofun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions