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

add bulk insert method

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.1-beta
    • Component/s: API
    • Labels:
      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

            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: