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

add bulk insert method

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 2.0.1-beta
    • API
    • None

    Description

      add bulk insert method

      API :

      connection.queryBulk(sql, values) -> Promise

      sql: string | JSON SQL string or JSON object to supersede default connection options. When using JSON object, object must have a "sql" key. For instance, { dateStrings: true, sql: 'SELECT now()' }
      values: array of array, or in case of having one parameter per row, a single array.
      

      Returns a promise that :

      resolves with a JSON object or with an Error.

      For instance, when using an SQL string:

      connection
        .queryBulk("INSERT INTO myTable(col1, col2) values (?, ?)", [[1, 'john'], [2, 'jack']])
        .then(rows => {
      	console.log(rows); 
        })
        .catch(err => {
      	//handle error
        });
      

      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.