Uploaded image for project: 'MariaDB Connector/node.js'
  1. MariaDB Connector/node.js
  2. CONJS-198

Feature request: checkNumberRange: boolean

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.1
    • Component/s: other
    • Labels:
      None

      Description

      see https://github.com/mariadb-corporation/mariadb-connector-nodejs/issues/201

      BigInt as a safe default is good, but I often find it quite impractical, because mariadb returns BIGINT from various operations like COUNT or col + 1 (note CAST(aBigInt AS INT) still results in BIGINT).
      At the moment we can either choose to use the default safe behavior, but then we have to check the range and cast these to number manually or we can use bigIntAsNumber: true for convinience, but risk an invalid behavior in edge cases.
      I propose introducing a new option, which would provide conviniency, but would fail loudly in case of possible error:
      checkNumberRange: boolean
      When set to true, the driver throws and error if DECIMAL/BIGINT can't be converted safely to number.
      The option is only effective when one of insertIdAsNumber/decimalAsNumber/bigIntAsNumber is true.
      Defaults to false for BC reasons.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.