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

Permit values in SQL object to permits compatibility with mysql/mysql2

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 2.2.0
    • API
    • None

    Description

      Permits passing values in sql object to permit compatibility with mysql/mysql2, permitting compatibility with sql-template-strings at the same time.

      standard API is using :

      connection.query('SELECT ? as a', ['myValue'])
         .then(rows => {
            console.log(rows); //[ { 'a': myValue' }, meta: [ ... ] ]
        })
        .catch(...)
      

      or sql object:

      connection.query({sql:'SELECT ? as a'}, ['myValue'])
         .then(rows => {
            console.log(rows); //[ { 'a': myValue' }, meta: [ ... ] ]
        })
        .catch(...)
      

      Using sql object, value can be given as 'values' entry:

      connection.query({sql:'SELECT ? as a', value: ['myValue']})
         .then(rows => {
            console.log(rows); //[ { 'a': myValue' }, meta: [ ... ] ]
        })
        .catch(...)
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            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.