Docs/Engines/MariaDB

MariaDB

MariaDB shares the MySQL driver and configuration keys. Keep type: mariadb so the MariaDB-specific rules below apply instead of MySQL’s.

type
mariadb
Driver
pymysql
DDL
Auto-commits
Config class
MySQL

Install

pip install "dblift[mariadb]"

Connection URL

mysql+pymysql://user:password@localhost:3306/app

mariadb:// and mariadb+pymysql:// URLs are both accepted and normalised to mysql+pymysql. Engine identity comes from type, not from the URL scheme.

dblift.yaml

database:
  type: mariadb
  url: "mysql+pymysql://db.internal:3306/app"
  ssl_enabled: true
  connection_timeout: 30

Engine settings

KeyDefaultEffect
ssl_enabledfalseAdds ssl=true to the connection URL.
connection_timeout30Sent to the driver as connect_timeout.
session_variables{}Rendered into one SET SESSION statement and passed as init_command.
options{}Merged into the URL query string after extra_params.

Behaviour notes

DDL auto-commits, as on MySQL.

A failed migration leaves earlier statements applied.

A subquery may read the table being updated.

MySQL error 1093 does not apply here, so DBLift emits the plain form rather than a derived table.

Catalog reads do not need a rollback.

Unlike MySQL, no rollback is issued after introspection.

JSON is stored as text.

MariaDB’s JSON type is a LONGTEXT alias with a validity check and has no CAST(… AS JSON), so JSON values bind as plain text with no cast.

Two features are version-gated.

ALTER TABLE … RENAME COLUMN needs 10.5.2 or later; native JSON typing needs 10.2 or later.

Generated SQL targets 10.5.2 or later.

A captured server older than 10.5.2 is warned about. Nothing is rendered differently for it.