The X DevAPI allows you to work with JSON documents and SQL
tables at the same time. Furthermore, the CRUD style API is more
intuitive than SQL statements for some programmers. Either way,
the X DevAPI allows you to mix JSON documents, SQL tables, CRUD
methods, and SQL statements to give you the best of all worlds.
In MySQL Connector/Python, the X DevAPI is implemented in the
mysqlx module.

This blog will look at how MySQL Connector/Python handles
expressions, and how you in version 8.0.14 and later need to use
the mysqlx.expr() method to explicitly
define expressions.

The MySQL X DevAPI is the new API that provides a uniform API
across the supported programming languages. It has from the
beginning supported that you can specify a default schema, when
you connect. Originally it was not used for SQL statements.
Starting with MySQL 8.0.14 the feature has been extended, so SQL
statements take the default schema into consideration as well.
This blog will explore how this works using MySQL
Connector/Python. If you use a different programming language,
the change will work in a similar way.

In order to explore the feature, a sample program is needed. A
simple program that prints the MySQL Connector/Python version,
queries the city table in
the default schema, and either …

Since 5.7.12 MySQL includes what is called the X plugin, but also
it includes X protocol and X DevApi. But what is all this and how
does it work? Let me share a personal short story on how I found
myself investigating this feature. In a previous post I wrote about the MySQL Router tool,
and our colleague Mr.
Lefred pointed out that I was wrong about X protocol,
because I mentioned it was created to be used with JSON docs.
Given this input, I wanted to investigate in a little bit more
depth about what all this “X” means and how it can be used in our
day to day operations.

First problem I found is that the documentation is pretty
extensive in the how’s but it was really hard to find the what’s.
This is a bit strange, because for people trying to research
about …

Maybe the biggest new feature in MySQL 8 is the new transaction
data dictionary that improves the consistency of schema objects
among other things. To further protect the data in the data
dictionary, the data dictionary tables are hidden and their
content only exposed through the Information Schema. (One
exception is when you use the debug binary, then it is possible
to get direct access to the data dictionary tables. This is not
recommended at all on production systems!)

A side effect of the data dictionary tables being hidden is that
those that have had a habit of manipulating the tables directly
in MySQL 5.7 and earlier (I will not recommend doing that) will
no longer be able to do so. Examples of manipulating the tables
include …

If you have an application that need to use multiple connections
to the MySQL database for short periods of times, it can be a
good to use a connection pool to avoid creating a new connection
and going through the whole authentication process every time a
connection is needed. For the Python Database API (PEP249), MySQL
Connector/Python has had support for connection pools for a long
time. With the release of MySQL 8.0.13, the new X DevAPI also has
support for connection pools.

This blog will first cover the background of the X DevAPI
connection pool feature in MySQL Connector/Python. Then …

First of all, thanks to everyone who attended my sessions at the
recent Oracle OpenWorld and Code One in San Francisco. It was a
great privilege to be allowed to make a number of presentations.

All of the workbooks and scripts from the hands-on labs (HOL) and
the slides from the talks have been made available at OpenWorld’s
and Code One’s session catalogues. You can download the files by
using the OpenWorld catalog searching for my name or the
session number (see below). Click on the download icon for each
of the presentations you are interested in.

The MySQL Document Store became general available (GA) with MySQL
8. One of the nice features of the MySQL Document Store is the X
DevAPI that allows you to query the data from a multitude of
programming languages using the same API (but while retaining the
conventions of the language). The programming languages with
support for the X DevAPI includes JavaScript (Node.js), PHP,
Java, DotNet, and C++.

I will be using MySQL Connector/Python 8.0.12 for the example in
this blog. The example is executed on Microsoft Windows with
Python 3.6 installed, but it has also been tested on Oracle Linux
7 with Python 2.7. I do assume that MySQL Connector/Python has
been installed. If that is not the case, you can read how to do
it in the …

What is the X-DevApi? From insidemysql.com there is a definition of the
X-DevAPI and its features in the following paragraphs:

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
modern polyglot development environments such as microservices,
and the fact that they are based on a …

Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.