MySQL Connector/C++ 8.0.12 has been released

Dear MySQL users,

MySQL Connector/C++ 8.0.12 is the second GA release version of the MySQL Connector/C++ 8.0 series.

Connector/C++ 8.0 can be used to access MySQL implementing Document Store or in a traditional way, using SQL queries. It allows writing both C++ and plain C applications using X DevAPI and X DevAPI for C. It also supports the legacy API of Connector/C++ 1.1 based on JDBC4.

To learn more about how to write applications using X DevAPI, see “X DevAPI User Guide”

https://dev.mysql.com/doc/x-devapi-userguide/en/

See also “X DevAPI Reference” at

https://dev.mysql.com/doc/dev/connector-cpp/devapi_ref.html

and “X DevAPI for C Reference” at

https://dev.mysql.com/doc/dev/connector-cpp/xapi_ref.html.

For generic information on using Connector/C++ 8.0, see
https://dev.mysql.com/doc/dev/connector-cpp/

Note: For X DevAPI applications, Connector/C++ 8.0 requires MySQL Server 5.7.12 or higher with X Plugin enabled. For applications that use the legacy JDBC API, Connector/C++ 8.0 can use MySQL Server 5.5 or higher, and X Plugin is not required.

https://dev.mysql.com/doc/refman/5.7/en/document-store.html

To download MySQL Connector/C++ 8.0.12, see the “Generally Available (GA)
Releases” tab at
https://dev.mysql.com/downloads/connector/cpp/



Changes in MySQL Connector/C++ 8.0.12 (2018-07-27, General Availability)
  • Installation Notes
  • Packaging Notes
  • Security Notes
  • X DevAPI Notes
  • Bugs Fixed
Installation Notes * Because the Microsoft Visual C++ 2017 Redistributable installer deletes the Microsoft Visual C++ 2015 Redistributable registry keys that identify its installation, standalone MySQL MSIs may fail to detect the Microsoft Visual C++ 2015 Redistributable if both it and the Microsoft Visual C++ 2017 Redistributable are installed. The solution is to repair the Microsoft Visual C++ 2017 Redistributable via the Windows Control Panel to recreate the registry keys needed for the runtime detection. Unlike the standalone MSIs, MySQL Installer for Windows contains a workaround for the detection problem. Packaging Notes * An RPM package for installing ARM 64-bit (aarch64) binaries of Connector/C++ on Oracle Linux 7 is now available in the MySQL Yum Repository and for direct download. Known Limitation for this ARM release: You must enable the Oracle Linux 7 Software Collections Repository (ol7_software_collections) to install this package, and must also adjust the libstdc++7 path. See Yum's Platform Specific Notes (http://dev.mysql.com/doc/refman/8.0/en/linux- installation-yum-repo.html#yum-install-platform-specifics) for additional details. * Installers for Connector/C++ are now available in these formats: MSI packages (Windows); RPM packages (Linux); DMG packages (macOS). Security Notes * yaSSL is no longer included in Connector/C++ source distributions. wolfSSL may be used as a functionally equivalent alternative that has a GPLv2-compatible license. In addition, wolfSSL (like OpenSSL) supports the TLSv1.2 protocol, which yaSSL does not. To build Connector/C++ using wolfSSL, use the -DWITH_SSL=path_name CMake option, where path_name indicates the location of the wolfSSL sources. For more information, see Source Installation System Prerequisites (http://dev.mysql.com/doc/connector-cpp/8.0/en/connector -cpp-installation-source-prerequisites.html), and Connector/C++ Source-Configuration Options (http://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp -source-configuration-options.html). X DevAPI Notes * Connector/C++ now supports NOWAIT and SKIP LOCKED lock contention modes to be used with lockExclusive() and lockShared() clauses of CRUD find/select operations (see Locking Read Concurrency with NOWAIT and SKIP LOCKED (http://dev.mysql.com/doc/refman/8.0/en/innodb -locking-reads.html#innodb-locking-reads-nowait-skip-locked), and a default lock contention mode. The following list names the permitted constants. For each item, the first and second constants apply to X DevAPI and X DevAPI for C, respectively. + LockContention::DEFAULT, LOCK_CONTENTION_DEFAULT: Block the query until existing row locks are released. + LockContention::NOWAIT, LOCK_CONTENTION_NOWAIT: Return an error if the lock cannot be obtained immediately. + LockContention::SKIP_LOCKED, LOCK_CONTENTION_SKIP_LOCKED: Execute the query immediately, excluding from the query items that are locked. For X DevAPI and X DevAPI for C applications, lock mode methods accept these lock contention constants as a parameter. For X DevAPI applications, lock mode methods can be called without this parameter, as before; this is equivalent to passing a lock mode of DEFAULT. * Connector/C++ now supports the SHA256_MEMORY authentication mechanism for connections using the X Protocol. For X DevAPI applications, SessionOption::AUTH supports the new value AuthMethod::SHA256_MEMORY. For X DevAPI for C applications, the session option MYSQLX_OPT_AUTH supports the new value MYSQLX_AUTH_SHA256_MEMORY. These new values request using the sha256_memory authentication mechanism when creating a session. * For compliance with the Core DevAPI, these Connector/C++ changes were made: + getAffectedItemsCount() was moved from Result to Result_common. + Collection.modify(condition).arrayDelete() was removed. + getAffectedRowsCount() was removed. Use getAffectedItemsCount() instead. + getWarningCount() was renamed to getWarningsCount(). Bugs Fixed * utf8mb4 character data was handled incorrectly. (Bug#28240202) * Session creation had a memory leak. (Bug #27917942) * When configuring to build Connector/C++ with the legacy connector, CMake did not account for the MYSQL_CONFIG_EXECUTABLE option. (Bug #27874173, Bug#90389) * Improper error handling for unknown hosts when creating a session could result in unexpected application exit. (Bug#27868302) * The mysqlx_row_fetch_one() X DevAPI for C function could fail to return for large result set exceeding the maximum packet size. Now such result sets produce an error. (Bug#27732224)

Enjoy and thanks for the support!

On Behalf of Oracle/MySQL Release Engineering Team,
Balasubramanian Kandasamy

MySQL Connector/ODBC 8.0.12 has been released

Dear MySQL users,

MySQL Connector/ODBC 8.0.12 is the second version of the MySQL Connector/ODBC 8.0 series, the ODBC driver for the MySQL Server.

The available downloads include both a Unicode driver and an ANSI driver based on the same modern codebase. Please select the driver type you need based on the type of your application – Unicode or ANSI. Server-side prepared statements are enabled by default. It is suitable for use with any MySQL server version from 5.5.

This release of the MySQL ODBC driver is conforming to the ODBC 3.8 specification. It contains implementations of key 3.8 features, including self-identification as a ODBC 3.8 driver, streaming of output parameters (supported for binary types only), and support of the SQL_ATTR_RESET_CONNECTION connection attribute (for the Unicode driver only).

The release is now available in source and binary form for a number of platforms from our download pages at

https://dev.mysql.com/downloads/connector/odbc/

For information on installing, please see the documentation at

https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation.html

Functionality Added or Changed

  • Several code issues identified by Fortify were corrected.
  • Refactored codebase to remove legacy code and implement general performance improvements. For example, unused ANSI data conversion code and legacy functions were removed. Example improvements affect bookmark handling for bulk operations, handling of memory buffers for prepared statements, and handling of session variables.
  • On Windows, 32-bit support was added and 32-bit binaries are now available.
  • An RPM package for installing ARM 64-bit (aarch64) binaries of Connector/ODBC on Oracle Linux 7 is now available in the MySQL Yum Repository and for direct download. Known Limitation for this ARM release: You must enable the Oracle Linux 7 Software Collections Repository (ol7_software_collections) to install this package, and must also adjust the libstdc++7 path. See Yum’s Platform Specific Notes (http://dev.mysql.com/doc/refman/8.0/en/linux-installation-yum-repo.html#yum-install-platform-specifics) for additional details.

Bugs Fixed

  • Added checks for unsupported functionality that return SQL_ERROR instead of SQL_SUCCESS, where the error message refers to the unsupported functionality. (Bug #28217387)
  • The data source dependent type’s name was not always returned. For example, the ODBC driver reported TEXT as the database type for TINYTEXT, MEDIUMTEXT, and LONGTEXT, and reported BLOB for TINYBLOB, MEDIUMBLOB, and LONGBLOB. (Bug #11761407, Bug #53900)

On Behalf of Oracle/MySQL Release Engineering Team,
Piotr Obrzut

MySQL Connector/NET 8.0.11 is available as official MySQL NuGet packages

Dear MySQL Connector/NET users,

We are proud to announce that the open source version of Connector/NET 8.0.11 is also available as official MySQL NuGet packages. Connector/NET 8.0.11 is a GA release that can be used in production environments. Additionally, users with an older version can safely upgrade if preferred.

 

What this means for Connector/NET users?

Installing and upgrading packages couldn’t be easier, plus you need only to install the packages that fit your needs. Also, it’s even easier and more straight forward to develop for MySQL from Visual Studio.

NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central software package repository populated by various package authors and tied directly to developers for ease of installation and development. For more information on NuGet see: https://github.com/nuget/home

Connector/NET NuGet Packages

Currently there are 5 Connector/NET NuGet packages:

  • MySQL Connector/NET Data
    • Provides the core functionality of Connector/NET including using MySQL as a Document Store through the X DevAPI. It implements the required ADO.NET interfaces and integrates into ADO.NET-aware tools. Provides access to multiple versions of MySQL Server and encapsulates database-specific protocols.
    • Supports .NET Framework 4.5.2, .NET Standard 1.6 & 2.0.
    • Refer to the official documentation for additional details.
    • Refer to the X DevAPI User Guide for details on using MySQL as a Document Store with Connector/NET.
  • MySQL Connector/NET Web providers
    • Includes support for the ASP.NET 2.0 provider model. This model enables application developers to focus on the business logic of their application instead of having to recreate boilerplate items such as membership and roles support.
    • Supported providers:
      • Membership
      • Role
      • Profile
      • Session State
    • Supports .NET Framework 4.5.2.
    • Refer to the ASP.NET Provider Model section of the official documentation for additional details.
  • MySQL Connector/NET for Entity Framework 6
    • Provides ORM capabilities enabling developers to work with MySQL databases using domain-specific objects, thus eliminating the need for most of the data access code.
    • Supports .NET Framework 4.5.2.
    • Refer to the Entity Framework 6 Support section of the official documentation for additional details.
  • MySQL Connector/NET for Entity Framework Core
    • Provides multi-platform support for Entity Framework tasks.
    • Supports .NET Framework 4.5.2, .NET Standard 1.6 & 2.0.
    • Refer to the Entity Framework Core Support section of the official documentation for additional details.
  • MySQL Connector/NET for Entity Framework Core Design
    • Provides shared design-time components for Entity Framework Core tools allowing the scaffolding and migration of databases.
    • Supports .NET Framework 4.5.2, .NET Standard 1.6.
    • Refer to the Entity Framework Core Support section of the official documentation for additional details.

In order to install the NuGet Package you can use the Package Manager Console as follows:

PM> Install-Package MySql.Data.EntityFrameworkCore

PM> Install-Package MySql.Data.Web

Or via Visual Studio’s NuGet Package Manager UI: http://docs.nuget.org/docs/start-here/Managing-NuGet-Packages-Using-The-Dialog

Note that packages for Web Providers and Entity Framework have a dependency with the core package MySql.Data, meaning their installation will also result in the installation of the MySql.Data package. Installation through the standalone MSI is recommended whenever you want to make use of all the functionality provided by Connector/NET E.g. availability in the GAC.

For more information or to go directly to our NuGet Packages review the following links:

For those of you interested in how to use Connector/NET with .NET Core you can refer to the MySQL Connector/NET for .NET Core 1.0 blog post.

If you happen to have any questions about this or any other Connector/NET related topic, you can always post them in the product’s main forum. Additionally, bugs can be reported in MySQL Bugs.

Connector/NET Team

MySQL Connector/NET 6.9.12 GA has been released

Dear MySQL users,

MySQL Connector/Net 6.9.12 is a maintenance release for the 6.9.x series
of the .NET driver for MySQL. It can be used for production
environments.

It is appropriate for use with MySQL server versions 5.5-5.7.

It is now available in source and binary form from
http://dev.mysql.com/downloads/connector/net/#downloadsandmirrorsites
(note that not all mirror sites may be up to date at this point-if you
can’t find this version on some mirror, please try again later or choose
another download site.)

Note: C/NET 6.9 will not be supported any more. If users are looking to get latest
updates on C/NET, they should upgrade to using C/NET 6.10 and 8.0 series instead.

Changes in MySQL Connector/Net 6.9.12 (2018-05-04, General
Availability)

Functionality Added or Changed

* Connections made to MySQL 8.0 (up to and including
version 8.0.3) and compatibility with the new data
dictionary are now supported. For information about the
data dictionary, see MySQL Data Dictionary
(http://dev.mysql.com/doc/refman/8.0/en/data-dictionary.h
tml).

* Support for the caching_sha2_password authentication
plugin through the classic MySQL protocol was added. In
addition, the sha256_password plugin was extended to
support authentication when RSA keys are available
through non-secure connections. Caching SHA-2 pluggable
authentication offers faster authentication than basic
SHA-256 authentication.

* Support was added for the new caching_sha2_password
padding mechanism introduced in the MySQL 8.0 release
series. The new padding mechanism is enabled when all of
the following conditions apply:

+ The user account is set with the
caching_sha2_password authentication plugin.

+ SSL is disabled explicitly (SslMode=none).

+ The AllowPublicKeyRetrieval connection option is
enabled (AllowPublicKeyRetrieval=true).
When enabled, the new padding mechanism is used to encode
the password during RSA key encryption, which applies the
correct padding to match the server.

Bugs Fixed

* The MySqlConnection.GetSchema(“PROCEDURES”, restrictions)
method call generated an error message, instead of
returning stored procedures, when the server connection
was to the MySQL 8.0 release series. (Bug #25961782)

* Attempting to generate an Entity Framework model from a
MySQL 5.7 database using either EF5 or EF6 produced an
exception that prevented the operation from generating
the expected model. (Bug #22173048, Bug #79163)

The documentation is available at:
http://dev.mysql.com/doc/connector-net/en/

Nuget packages are available at:
https://www.nuget.org/packages/MySql.Data/6.9.12
https://www.nuget.org/packages/MySql.Data.Entity/6.9.12
https://www.nuget.org/packages/MySql.Fabric/6.9.12
https://www.nuget.org/packages/MySql.Web/6.9.12

Enjoy and thanks for the support!

On behalf of the MySQL Release Team,
Sreedhar S

MySQL Connector/NET 6.10.7 GA has been released

Dear MySQL users,

MySQL Connector/NET 6.10.7 is the fourth GA release with .NET Core
now supporting various connection-string options and MySQL 8.0 server
features.

To download MySQL Connector/NET 6.10.7 GA, see the “Generally Available
(GA) Releases” tab at http://dev.mysql.com/downloads/connector/net/

Changes in MySQL Connector/NET 6.10.7 (2018-04-30, General Availability)

Functionality Added or Changed

* Connections made to MySQL 8.0 (up to and including
version 8.0.3) and compatibility with the new data dictionary are
now supported. For information about the data dictionary, see
MySQL Data Dictionary
(http://dev.mysql.com/doc/refman/8.0/en/data-dictionary.html).

* Support for the caching_sha2_password authentication
plugin through the classic MySQL protocol was added. In addition,
the sha256_password plugin was extended to support authentication
when RSA keys are available through non-secure connections.
Caching SHA-2 pluggable authentication offers faster
authentication than basic SHA-256 authentication.

* Support was added for the new caching_sha2_password
padding mechanism introduced in the MySQL 8.0 release series. The
new padding mechanism is enabled when all of the following
conditions apply:

+ The user account is set with the
caching_sha2_password authentication plugin.

+ SSL is disabled explicitly (SslMode=none).

+ The AllowPublicKeyRetrieval connection option is enabled
(AllowPublicKeyRetrieval=true).  When enabled, the new padding
mechanism is used to encode the password during RSA key
encryption, which applies the correct padding to match the
server.

Bugs Fixed

* Attempting to open the MySQL Web Configuration Tool, with
Connector/NET and MySQL for Visual Studio prerequisites installed
properly, displayed an error message instead of opening the tool.
(Bug #27457398, Bug #88544)

* The ADO.NET Entity Data Model wizard within Visual Studio
closed unexpectedly without producing the data model.  Thanks to
Laurents Meyer for the patch. (Bug #27420311, Bug #89338)

* An exception prevented MySQL.Data.Entity for Entity
Framework 6 from operating as expected. Thanks to Cédric Luthi
for the patch. (Bug #27360520, Bug #89134)

* MySQL Installer could not be installed with NuGet
packages from Microsoft Visual Studio 2015. (Bug #27251839,
Bug #88838)

* With valid references to the DLLs provided, using
DbConfiguration.SetConfiguration(new
MySql.Data.Entity.MySqlEFConfiguration()) to set up the DbContext
threw an exception. (Bug #25185319)

* Attempting to generate an Entity Framework model from a
MySQL 5.7 database using either EF5 or EF6 produced an exception
that prevented the operation from generating the expected model.
(Bug #22173048, Bug #79163)

Nuget packages are available at:

https://www.nuget.org/packages/MySql.Data/6.10.7
https://www.nuget.org/packages/MySql.Web/6.10.7
https://www.nuget.org/packages/MySql.Data.Entity/6.10.7
https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/6.10.7
https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore.Design/6.10.7

Enjoy and thanks for the support!

On behalf of the MySQL Release Team,
Nawaz Nazeer Ahamed

MySQL Connector/Python 8.0.11 has been released

Dear MySQL users,

MySQL Connector/Python 8.0.11 is the first GA release version of the MySQL Connector Python 8.0 series. This series adds support for the new X DevAPI. 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.

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/Python, and its usage, see http://dev.mysql.com/doc/dev/connector-python.

Please note that the X DevAPI requires MySQL Server version 5.7.12 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/5.7/en/document-store.html.

To download MySQL Connector/Python 8.0.11, see the “General Available
(GA) releases” tab at http://dev.mysql.com/downloads/connector/python/

Enjoy!


Changes in MySQL Connector/Python 8.0.11 (2018-04-19)

     * Functionality Added or Changed

     * Bugs Fixed

   Functionality Added or Changed

     * X DevAPI: Previously, when documents without an _id
       attribute were added to a collection, Connector/Python
       automatically generated _id for them. Now a MySQL 8
       server generates the _id attribute unless a document
       already contains one. The generated IDs resulting from a
       document-add operation can be obtained using the new
       get_generated_ids() method.
       This capability requires a MySQL 8.0 server. Because
       MySQL 5.7 does not support document ID generation, the
       document-add operation returns an error if you do not
       define the _id's.
       Incompatibility: The get_generated_ids() method replaces
       the now removed get_document_ids(). (Bug #27627366)

     * Added NOWAIT and SKIP_LOCKED support to the
       ReadStatement.lock_shared() and
       ReadStatement.lock_exclusive() methods. Example usage:
       lock_exclusive(mysqlx.LockContention.SKIP_LOCKED).

     * The C extension (cext) is now enabled by default, as the
       use_pure option changed from True to False by default.
       If the C extension is not available on the system then
       the Python implementation is used instead, and use_pure
       is set to True.

     * Added the X DevAPI SHA256_MEMORY authentication
       mechanism.
       Example mysqlx.get_session() usages: ?auth=SHA256_MEMORY
       via a connection string, "auth":
       mysqlx.Auth.SHA256_MEMORY via a dictionary, or
       auth=mysqlx.Auth.SHA256_MEMORY via method parameters.

   Bugs Fixed

     * Warnings are now stored as a list of dictionaries instead
       of a list of tuples. In other words, get_warnings()
       returns the likes of [{"level": _level_, "code": _code_,
       "msg": _msg_}] instead of [(_level_, _code_, _msg_))].
       (Bug #27639119)

     * The mapped MySQL Server error codes were synced with
       MySQL Server 8.0.11. (Bug #27634885)

     * Removed upsert functionality from InsertStatement as it
       can only be used by collections, so upsert remains
       available to AddStatement. (Bug #27589450)

     * MySQLConverter.escape() functionality was added to
       create_schema()'s count mechanism. (Bug #27528842)

     * When using prepared statements, string columns were
       returned as bytearrays instead of strings. The returned
       value is now a string decoded using the connection's
       charset (defaults to 'utf8'), or as a bytearray if this
       conversion fails. (Bug #27364914)

     * The result from JSON_TYPE() was returned as a bytearray
       instead of a string. The returned value is now a string
       decoded using the connection's charset (defaults to
       'utf8'), or as a bytearray if this conversion fails. (Bug
       #24948205, Bug #83516)

     * JSON integer values were cast to bytes in Python instead
       of integers. (Bug #24948186, Bug #83513)

On Behalf of Oracle/MySQL Release Engineering Team
Prashant Tekriwal

MySQL 8.0 – Welcome to the DevAPI!

 

By now you’ve read Mike Frank’s excellent introduction to the MySQL 8.0 release and it’s Document Store.  In that post Mike laid out the benefits of the new Document Store model and briefly outlined the different components involved.  While it’s fair to consider the Document Store as the first pillar of the new MySQL 8 Document story, we must identify the X DevAPI to be the second.  The post covers our motivation, goals, and overall design principles of this new API.

Motivation

Most of our connectors have not implemented their own API.  Rather, most of them implement externally defined interfaces.   Examples include our Connector/J that implements the JDBC standard, Connector/Net that implements the ADO.Net standard, and our Connector/ODBC.  None of these standards work well for a document-oriented database.  In fact, there really are no defined standard APIs for document databases.  Therefore we knew we needed to develop a new API for our users.

Another reason why we needed a new API is because we are doing something that has not been done before.  Document databases exist.  Relational databases exist.  We even see databases that support relational and document querying over the same data set.  However we have yet to see a relational database include a document model so that a user can use document objects alongside their existing relational data.

We are only beginning to bring forth the unifying power of MySQL 8.   In the coming releases you’ll see exciting developments like being able to link your existing relational data with your document data in a single query using simple API patterns.

Goals

We have some very clear goals we follow as we develop the X DevAPI.  They are:

  • Simplicity — No one likes a complicated API.  We wanted the API to be easy to understand no matter what language you are using.   It’s important to us that if you write X DevAPI code using Node.JS then a Python developer, for example, can read it and know what is going on.
  • Bridge the gap between relational and document data — MySQL runs some of the world’s largest web properties and they have petabytes of relational data.  Asking them to add tables or columns to their data stores can be very challenging.  The new document store allows connecting these different types of data in the same queries.  We want to provide a powerful API for this.
  • Expressive — We wanted our API to be very expressive and follow a fluent interface style of development.  We wanted this to enable writing and executing the same X DevAPI code in the shell as in your application.
  • Seamless support for InnoDB Cluster farms — We want the API to seamlessly and transparently allow simple development of applications that span from one machine to hundreds.

Please note that these are goals. Some of them may not be fully realized in the initial release of the X DevAPI but these goals outline what we are thinking about during this development.

Design

No matter what connector you use the design of the X DevAPI core components remains the same.  The API involves some central objects outlined below. You’ll hear more about these objects and more in the individual product announcements and in our documentation found at https://dev.mysql.com/doc/.

Session Represents a logical connection to a server or farm
Schema Represents a MySQL database/schema
Collection Represents a collection of JSON documents
Result There’s a series of Result objects that handle different scenarios

Our goal is that each connector will include a core API (set of objects, properties and methods) that are the same across all connectors.  Outside of the core API, each connector can and will provide additional syntax or support additional methods.

Of course we also realize that each language and framework has it’s own style and it’s important to us to be respectful of that.  An example might be a count property that might appear as .Count  in one language but should be represented as .getCount()  in another.  Again, please recognize they are the same concept just different syntax.

Looking at the New X DevAPI Syntax

You’ll learn much more about the X DevAPI and our different languages when you read our announcement blogs and our documentation but I wanted to take just a minute to give quick examples of how you can use the X DevAPI in the shell to do quick ad-hoc prototyping.  First let’s look at opening a session to server.  In this example we open a session  to localhost and get a reference to the test schema so we can work with it.

Next we’ll create a collection and add a document to it.

We can modify the document very easily.  This example finds all documents that have a length of 250 and changes that length to 125.

We can find those documents if we want to work with them

And finally we can remove the documents and drop our collection

These have just been some quick examples but we hope that it has shown some of the basic ideas we have in the X DevAPI and you are interested in learning more and trying it out.

Availability

With the release of MySQL 8.0 we are also making available 8.0 GA versions of our connectors.  Each of them, save ODBC, provide an initial implementation of X DevAPI.  These connectors should be installed from their respective package stores.  You can also find them at our website at https://www.mysql.com/downloads/.

You can read much more about each of the products on their announcement blogs:

We know that we have not covered every language available.  If you are using MySQL 8 with a connector in a different language please let us know.  We want to work with the community to bring X DevAPI to more and more languages.

Thank you!

I want to thank you for your time to read this and learn about our new products.  I hope that you will take the time to get to know what we’ve created and let us know where we fell down.  We have much more planned and we want to hear from you!

Introducing Connector/Node.js for MySQL 8.0

As you may have heard, MySQL 8.0 is now officially GA, and it comes with a bunch of additional goodies. Among those is the brand new Connector/Node.js, which is the official MySQL driver for Node.js and, currently, the only one with support for the latest server versions and features (such as the MySQL document store).

Here’s a rundown of what’s available:

  • Out-of-the box support for MySQL 8.0
  • Document-store API as a first-class citizen
  • TLS/SSL and SHA256 authentication
  • Fluent API with support for flexible parameters
  • Semantic methods to encode common CRUD operations
  • Modern Node.js asynchronous interface based on Promises
  • Abstractions for common database development tasks
  • Transactions, savepoints and row locking

MySQL 8.0

Connector/Node.js is currently the only driver in the Node.js ecosystem that works out-of-the-box with the latest MySQL 8.0 series and implements the brand new X Protocol and X DevAPI, which unlocks exclusive server features such as the MySQL document store.

In a nutshell, the X Protocol is based on the Google Protocol Buffers serialization format, and provides a common interface for a different set of official connectors to bridge into the MySQL server via the X plugin, which contains the server-side implementation of the document store and a surrounding scaffolding ecosystem including things like common CRUD expression trees, bound parameters, or expectations and conditions for statement pipelining.

The X DevAPI is the common client-side API used by all connectors to abstract the details of the X Protocol. It specifies the common set of CRUD-style functions/methods used by all the official connectors to work with both document store collections and relational tables, a common expression language to establish query properties such as criteria, projections, aliases, and a standard set of additional database management features for handling things like transactions, indexes, etc.

The fact that most of these features share the same format and API between connectors, makes the X DevAPI a perfect fit for mordern polyglot development environments such as microservices, and the fact that they are based on a well-documented format allows advanced users to extend client-side implementations and build new middleware components or extensions tailor-made for their use case.

Although, there are (most of the times) matching client APIs to work with relational tables, this overview will focus mostly on document-store related features. Check the official Connector/Node.js documentation or the X DevAPI user guide to get the full picture.

Secure by default

With Connector/Node.js, SSL/TLS is enabled by default for server TCP connections and, additionally, the server identity can be validated against a given certificate authority (CA).

Of course you can explicitely override this behavior (at your own peril).

Local Unix sockets don’t use SSL/TLS since they don’t really benefit much from that level of security. At the same time, that removes the possibility of any additional performance overhead caused by the SSL/TLS handshake.

In the authentication realm, besides the traditional SHA1-based server authentication plugin, Connector/Node.js also supports the latest secure authentication plugins based on SHA-256. Of course you can always use your own custom server plugins, as long as the authentication data can be sent using one of the existing client-side authentication mechanisms (in the simplest form, via plain text).

Additional details about Connector/Node.js security can be found here.

Fluent API

The public API flows nicely from a single getSession()  method. Whereas, when it comes the point of creating and issuing database operations, you get a nice fluent query builder where those operations are encapsulated in specialized and specific methods, which, compared to using raw SQL statements, brings benefits such as:

  • more readable, maintainable (and even testable) code
  • better tooling integration
    • scaffolding for code refactoring
    • text-editor (or IDE) hints and auto-completion
  • smaller SQL injection surface area
  • common standard between different programming languages and environments

Most public API methods provide alternative input handling flavors:

  • multiple individual arguments
  • a single array of arguments
  • an object with named properties (where it applies)

Promise-based asynchronous tasks

Being a good Node.js citizen, Connector/Node.js encapsulates all blocking I/O operations with asynchronous methods. Each method that sends a message to the MySQL server is expected to return a JavaScript Promise , which resolves to the specific result or fails with an error. This pattern also unlocks other platform abstractions such as the async/await  syntax, making it even more flexible for the user than just using traditional error-first callbacks.

So, after building a query, it can be sent to the server via the execute()  method. In turn, the method receives an optional callback as argument, which runs for each element in the result set. When using relational tables, an additional callback function can be used to tap into the given column metadata.

Other methods, such as the ones that operate on a single instance of a connection, database object (be it a schema, table/collection, row, document, etc.) will return a Promise  by themselves (dropping the extra call to execute() ). Some examples:

  • mysqlx.getSession()
  • session.getSchemas()
  • session.createSchema()
  • schema.getCollections()
  • schema.createCollection()
  • collection.getOne()
  • collection.addOrReplaceOne()
  • collection.replaceOne()
  • collection.createIndex()

Data consistency

With MySQL 8.0, you get session-level consistency and document-level isolation via multiple database constructs, such as transactions, savepoints and row locking. This allows to encapsulate a set of operations (particularly DML) encompassing multiple documents or collections in a single atomic procedure within a given session.

Connector/Node.js provides APIs to create, commit or rollback a transaction as well as to create, release or rollback to an intermediate savepoint within that transaction.

In the presence of concurrent transactions, the isolation level of each operation within the transaction, operating on a given document, can be determined using row locks.

Raw SQL interface

If you are looking for a feature that is still not available on the X DevAPI, or simply something that does not fit the CRUD model, you can always resort to plain old SQL.

Getting Started

If you want to use Connector/Node.js in your own project or just want to play around with, download the latest version from npm:

New releases DO NOT follow semantic versioning, so, to avoid being affected by breaking changes, make sure you use --save-exact  when pulling the package, particularly if you don’t have npm-shrinkwrap.json  or package-lock.json  files locking down your project’s dependencies.

If you are an advanced user, being an open source project, the code is hosted on the official GitHub repository and contributions are welcome, either in the form of bugs ( Connector for Node.js  category) or pull requests.

Up and Running

Assuming you are running MySQL 8.0 with the default configuration and Node.js v8.0.0  or later (for async/await  support), using Connector/Node.js and the MySQL document store in your project is as simple as follows:

These are just some of the highlights. Make sure you check out the official Connector/Node.js documentation or the X DevAPI user guide for usage examples and even more details on how to get started.

Please give it a try! Your feedback is more than welcome.

Using MySQL Connector/Python 8.0 with MySQL 8.0

The MySQL Connector/Python Team is pleased to announce MySQL Connector/Python 8.0.11, the first GA 8.0 release series of the official MySQL driver for Python. This release introduces the first Python driver that adds full MySQL 8.0 support.

Document Store

MySQL 8.0 includes many improvements and new features, with Document Store being the biggest.

MySQL Document Store is schema-less with a flexible data structure storage system for documents. This removes the requirement for schema design, normalization, foreign keys, constrains, and data types.

The Document Store is accessible by the X DevAPI, an API that introduces a new modern and easy-to-learn way to work with your data that is implemented by all MySQL Connectors that support the X Protocol, such as MySQL Connector/Python.

Getting Started

Installation

Requirements:

The recommended way to install Connector/Python is via pip.

Packages are also available from the MySQL Connector/Python downloads site. For some packaging formats, there are different packages for different versions of Python. Choose the one appropriate for the version of Python installed on your system.

For installation documentation, please visit the Connector/Python installation guide.

Writing your first program using the MySQL Document Store

Assuming Connector/Python 8.0 is installed on your system and you’re accessing a MySQL 8.0 server, you’re ready to write your first program using the MySQL Document Store.

For a detailed explanation of this code, please visit the Getting Started section of the official MySQL Connector/Python X DevAPI Reference Documentation.

Improved Security

Server TCP connections are now secure by default, meaning the default SSL Mode is now set to REQUIRED (mysqlx.SSLMode.REQUIRED).
Support was also added for the latest secure MySQL 8 authentication plugins based on SHA-256 hashing, such as new the caching_sha2_password authentication plugin. Usage can be implicit or explicit, for example:

Fluent API

The X DevAPI operations are structured to be “fluent”. This means it’s possible to call multiple methods to modify an object prior to execution, which enables a fluent query builder and allows more readable, maintainable, and secure code.

An example is following where where() and sort() are fluent methods to modify the find operation prior to executing it.

Support for raw SQL statements

The X DevAPI allows you to execute raw SQL statements to combine the flexibility of the document store model with the power of the relational model.

Transactions, Savepoints and Row Locking

Connector/Python provides an API to create, commit, or rollback a transaction, and also to create, release, or rollback to an intermediate savepoint within that transaction.

An optional savepoint name can be defined to create a transaction savepoint, which can later be used to rollback.

If a savepoint name is not provided, then mysqlx.Session.release_savepoint() will return a generated savepoint name.

To learn more about writing applications using the MySQL X DevAPI with Connector/Python and other MySQL connectors and clients, see http://dev.mysql.com/doc/x-devapi-userguide/en/

For general documentation about how to get started using MySQL as a document store, see https://dev.mysql.com/doc/refman/8.0/en/document-store.html

For more information about how the X DevAPI is implemented in MySQL Connector/Python, and its usage, see https://dev.mysql.com/doc/dev/connector-python/8.0/

We welcome and appreciate your feedback and bug reports: http://bugs.mysql.com/

Enjoy!

MySQL Connector/NET 8.0.11 has been released

Dear MySQL users,

MySQL Connector/NET 8.0.11 is the first general availability release of
Connector/NET to add support for the new X DevAPI. 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.

To learn more about how to write applications using the X DevAPI, see
http://dev.mysql.com/doc/x-devapi-userguide/en/index.html. For more
information about how the X DevAPI is implemented in Connector/NET, see
http://dev.mysql.com/doc/dev/connector-net. Users relying on NuGet                packages need to install the MySql.Data package to be able to use the                          X DevAPI.

Please note that the X DevAPI requires at least MySQL Server version
5.7.12 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/5.7/en/document-store.html.

To download Connector/NET 8.0.11, see
http://dev.mysql.com/downloads/connector/net/.

Installation instructions can be found at https://dev.mysql.com/doc/connector-net/en/connector-net-installation.html.


Changes in MySQL Connector/NET 8.0.11 (2018-04-19)

   Functionality Added or Changed

     * X DevAPI: Connector/NET now supports the NOWAIT and
       SKIP_LOCKED locking options introduced in the MySQL 8.0
       release series (see SELECT Syntax
       (http://dev.mysql.com/doc/refman/5.7/en/select.html)).
       The following changes were made to the Connector/NET API:

          + The LockContention enumeration (with values
            Default=0, NoWait=1 and SkipLocked=2) was added. The
            Default enumeration member represents the previous
            behavior of waiting for the row locks to be
            released.

          + The existing LockShared() and LockExclusive() method
            signatures were modified to include the new
            LockContention parameter. Both methods are members
            of the MySqlX.XdevAPI.CRUD.FindStatement and
            MySqlX.XdevAPI.Relational.TableSelectStatement
            classes.

          + Usage examples:
// Default behavior - waits for the row locks to release
LockShared()
LockShared(LockContention.Default)

LockExclusive()
LockExclusive(LockContention.Default)

// New - fails if the rows are locked
LockShared(LockContention.NoWait)
LockExclusive(LockContention.NoWait)

// New - succeeds excluding the locked rows from the result
LockShared(LockContention.SkipLocked)
LockExclusive(LockContention.SkipLocked)


     * X DevAPI: Previously, when documents without an _id
       attribute were added to a collection, Connector/NET
       automatically generated IDs for them. Now the server
       generates the _id attribute, unless a document already
       contains one. The generated IDs resulting from a
       document-add operation can be obtained using the new
       Result.GeneratedIds property, which returns a list.
       This capability requires a MySQL 8.0 GA server. If the
       server does not support document ID generation, the
       document-add operation returns an error indicating that
       document IDs were missing.
       Incompatibility: The GeneratedIds property replaces the
       DocumentId and DocumentIds properties, which are now
       removed.

     * X DevAPI: Support for the SHA256_MEMORY authentication
       mechanism was added to enable non-PLAIN insecure
       connections (without SSL) for user accounts with
       caching_sha2_password, which is the default
       authentication plugin introduced in the MySQL 8.0 release
       series. The changes related to this support include:

          + New synonyms for the auth connection string option:
            authentication and authentication mode (see General
            Options
           (http://dev.mysql.com/doc/connector-net/en/connector-net-connection-options.
          html#connector-net-connection-options-general)).

          + A new authentication mode for the
            MySqlAuthenticationMode enumeration: SHA256_MEMORY.
            In addition, the Default member now has a new
            synonym: Auto=0.

          + A new class:
            MySql.Data.MySqlClient.Authentication.Sha256MemoryAu
            thenticationPlugin.

     * Support was added for the new caching_sha2_password
       padding mechanism introduced in the MySQL 8.0 release
       series. The new padding mechanism is enabled when all of
       the following conditions apply:

          + The user account is set with the
            caching_sha2_password authentication plugin.

          + SSL is disabled explicitly (SslMode=none).

          + The AllowPublicKeyRetrieval connection option is
            enabled (AllowPublicKeyRetrieval=true).
       When enabled, the new padding mechanism is used to encode
       the password during RSA key encryption, which applies the
       correct padding to match the server.

   Bugs Fixed

     * Attempting to open the MySQL Web Configuration Tool, with
       Connector/NET and MySQL for Visual Studio prerequisites
       installed properly, displayed an error message instead of
       opening the tool. (Bug #27457398, Bug #88544)

     * MySQL Installer could not be installed with NuGet
       packages from Microsoft Visual Studio 2015. (Bug
       #27251839, Bug #88838)

     * When a decimal column was defined with a scale of zero,
       such as DECIMAL(8, 0), the value of the NumericPrecision
       field returned by the MySqlDataReader.GetSchemaTable
       method was lower by one. For example, it returned 7
       instead of 8 as expected. (Bug #26954812, Bug #88058)

     * The data table returned by the
       MySqlDataReader.GetSchemaTable method had an inaccurate
       value of zero assigned to the ColumnSize field for
       LONGTEXT and LONGBLOB data types, and also indicated that
       the IsLong field value was false when it should have
       returned true. (Bug #26876592, Bug #87876)

     * The MySqlDataReader.GetSchemaTable method returned
       different column-size values when used with different
       character sets. (Bug #26876582, Bug #87868)

     * Support for making a secure connection to a server
       configured to use TLSv1.2 was limited by external
       factors. (Bug #25689154)

     * Connection strings that included TLS/SSL connection
       parameters in URI type-string format generated an
       exception instead of making a connection with the X
       Protocol. (Bug #24510329)

     * Attempting to generate an Entity Framework model from a
       MySQL 5.7 database using either EF5 or EF6 produced an
       exception that prevented the operation from generating
       the expected model. (Bug #22173048, Bug #79163)