Rethinking Result Sets in Connector/Node.js

It used to be the case where, in order to actually process data retrieved from the database using Connector/Node.js, you would have to resort to an API that required the use of both JavaScript callbacks and Promises. This was meant to provide more flexibility and control to the application developer and at the same time decrease the chance of buffering data unnecessarily. However this wasn’t useful for 99% of the use-cases and made simple tasks a little bit cumbersome. Also, the fact that it required using two different asynchronous constructs made it a little bit harder to grasp.

To make matters worse, in order to consume operational metadata about the columns in the result set, you would have to provide an additional callback, making the whole thing spiral a bit out of control, particularly when there were multiple result sets involved. In that case, you needed to create a shared context between the two functions in order to map data and metadata for each column in each result set.

Continue reading

MySQL Connector/Node.js 8.0.19 has been released

Dear MySQL users,

MySQL Connector/Node.js is a new Node.js driver for use with the X
DevAPI. This release, v8.0.19, is a maintenance release of the
MySQL Connector/Node.js 8.0 series.

The X DevAPI enables application developers to write code that combines
the strengths of the relational and document models using a modern,
NoSQL-like syntax that does not assume previous experience writing
traditional SQL.

MySQL Connector/Node.js can be downloaded through npm (see
https://www.npmjs.com/package/@mysql/xdevapi for details) or from
https://dev.mysql.com/downloads/connector/nodejs/.

To learn more about how to write applications using the X DevAPI, see
http://dev.mysql.com/doc/x-devapi-userguide/en/.
For more information about how the X DevAPI is implemented in MySQL
Connector/Node.js, and its usage, see
http://dev.mysql.com/doc/dev/connector-nodejs/.

Please note that the X DevAPI requires at least MySQL Server version
8.0 or higher with the X Plugin enabled. For general documentation
about how to get started using MySQL as a document store, see
http://dev.mysql.com/doc/refman/8.0/en/document-store.html.

Changes in MySQL Connector/Node.js 8.0.19 (2020-01-13, General Availability)

Functionality Added or Changed

  • Added DNS SRV support.
    Using the mysqlx+srv scheme+extension in a connection
    string (or enabling the resolveSrv option in a connection
    configuration object) allows to automatically resolve any
    SRV record available in a target DNS server or service
    discovery endpoint.

Bugs Fixed

  • Improved the CRUD API error messages. (Bug #30423556)
  • The getAffectedItemsCount() method did not function on
    result sets in v8.0.18. (Bug #30401962)
  • The Collection.existsInDatabase() method did not
    function. (Bug #30401432)

On Behalf of MySQL/ORACLE RE Team
Gipson Pulla

MySQL Connector/Node.js 8.0.18 has been released

Dear MySQL users,

MySQL Connector/Node.js is a new Node.js driver for use with the X
DevAPI. This release, v8.0.18, is a maintenance release of the
MySQL Connector/Node.js 8.0 series.

The X DevAPI enables application developers to write code that combines
the strengths of the relational and document models using a modern,
NoSQL-like syntax that does not assume previous experience writing
traditional SQL.

MySQL Connector/Node.js can be downloaded through npm (see
https://www.npmjs.com/package/@mysql/xdevapi for details) or from
https://dev.mysql.com/downloads/connector/nodejs/.

To learn more about how to write applications using the X DevAPI, see
http://dev.mysql.com/doc/x-devapi-userguide/en/.
For more information about how the X DevAPI is implemented in MySQL
Connector/Node.js, and its usage, see
http://dev.mysql.com/doc/dev/connector-nodejs/.

Please note that the X DevAPI requires at least MySQL Server version
8.0 or higher with the X Plugin enabled. For general documentation
about how to get started using MySQL as a document store, see
http://dev.mysql.com/doc/refman/8.0/en/document-store.html.

Changes in MySQL Connector/Node.js 8.0.18 (2019-10-14, General
Availability)

Functionality Added or Changed

  • Implemented the X DevAPI cursor model, which includes
    adding methods such as fetchOne(), fetchAll(),
    getColumns(), hasData(), and nextResult(). For additional
    details, see the X DevAPI documentation about Working
    with Result Sets

(https://dev.mysql.com/doc/x-devapi-userguide/en/working-with-result-sets.html).
Previously, handling result set data or metadata required
specific callback functions when calling execute(). With
this new interface, the connector automatically switches
to this new pull-based cursor model if these callback
functions are not provided.

  • Improved Collection.getOne() performance by making the
    underlying lookup expression to only parse once, and
    having subsequent Collection.getOne() calls utilize
    server-side prepared statements.
  • Added support to generate test coverage reports by
    running the likes of npm run coverage; see the bundled
    CONTRIBUTING.md for details and requirements. This was
    added to help users contribute patches.
  • Added linter check support to help enforce coding style
    and convention rules for new contributions by running the
    likes of npm run linter; see the bundled CONTRIBUTING.md
    for details.

Bugs Fixed

  • Added support for assigning Node.js Buffer values to
    expression or SQL query placeholders. (Bug #30163003, Bug 96480)
  • MySQL column binary values (such as BLOB, BINARY, and
    VARBINARY) can now convert to proper Node.js Buffer
    instances. (Bug #30162858, Bug #96478)
  • Inserting a raw Node.js Buffer value into MySQL BLOB
    field resulted in an error as the content_type was
    improperly set; it’s now handled as a raw byte string by
    the X Plugin. (Bug #30158425)
  • The padding characters used for fixed-lengthed columns
    now map to the collation code provided by the column
    metadata; previously it was based on the JavaScript
    native type of the values. (Bug #30030159)

On Behalf of MySQL/ORACLE RE Team
Gipson Pulla