Class MariaDBSupport

All Implemented Interfaces:
DatabaseSupport

public class MariaDBSupport extends MySQLSupport
MariaDB-specific DatabaseSupport.

MariaDB is a MySQL fork that speaks the MySQL wire protocol, so its columns surface through JDBC essentially as MySQL's do. This class therefore extends MySQLSupport and inherits its full type handling and its session-variable bulk-load mechanism (FOREIGN_KEY_CHECKS/UNIQUE_CHECKS). The cross-database defaults cover the standard types; TINYINT UNSIGNED surfaces as JDBC TINYINT (type name "TINYINT UNSIGNED") and accepts the inherited 0–255 generator.

JSON cannot be auto-detected. Unlike MySQL — whose driver reports a JSON column with type name "JSON", letting MySQLSupport route it to a JSON generator — MariaDB implements JSON as an alias for LONGTEXT, and the MariaDB Connector/J driver reports such columns through DatabaseMetaData.getColumns(String, String, String, String) as JDBCType.LONGVARCHAR with type name "LONGTEXT" — indistinguishable from an ordinary LONGTEXT/TEXT column. Because MariaDB also adds an automatic CHECK (json_valid(col)) constraint, a random string would fail to insert. Bloviate therefore cannot generate valid JSON for a MariaDB JSON column automatically; supply a per-column override (a JsonbGenerator via ColumnConfiguration) for any such column.

Product-name caveat. The MariaDB Connector/J driver reports "MariaDB", which resolves to this class. The legacy MySQL Connector/J driver reports "MySQL" even against a MariaDB server and resolves to MySQLSupport; because this class adds no divergent behavior, that is equivalent.

Since:
2.18.0
See Also:
  • Constructor Details

    • MariaDBSupport

      public MariaDBSupport()
      Creates the MariaDB support with its default (MySQL-inherited) configuration.