Skip to content

[enhancement] Add MariaDB dialect support #426

@ajitpratap0

Description

@ajitpratap0

Source

Reddit comment by u/OttoKekalainen (score: 2) on the r/golang post "I benchmarked every Go SQL parser in 2026":

"Why didn't you test MariaDB? Many Linux distros haven't shipped MySQL for years, and have MariaDB only."

Issue

GoSQLX currently supports 6 dialects: PostgreSQL, MySQL, SQLite, SQL Server, Oracle, and ClickHouse. MariaDB is not included as a named dialect, even though it has diverged meaningfully from MySQL over the years (e.g. RETURNING clause in DML, SEQUENCE objects, JSON_TABLE, PERIOD FOR temporal tables, WITHOUT OVERLAPS, OFFSET...FETCH syntax differences, and more).

Many Linux distributions (Debian, Ubuntu, RHEL derivatives) ship MariaDB as the default instead of MySQL. Users on those systems who try the MySQL dialect may encounter parse failures or silent misparses on MariaDB-specific syntax.

Suggested fix

  1. Add a MariaDB dialect constant alongside the existing MySQL dialect in pkg/sql/keywords/.
  2. Identify and implement MariaDB-specific syntax extensions in the parser (start with RETURNING on INSERT/UPDATE/DELETE, SEQUENCE DDL, and WITHOUT OVERLAPS temporal constraints).
  3. Add a benchmark entry for MariaDB to the comparison article / README benchmark table.
  4. Document dialect differences between MySQL and MariaDB in docs/SQL_COMPATIBILITY.md.

Context

The Reddit post title is "I benchmarked every Go SQL parser" — not including MariaDB is a visible gap to the Go community, particularly on Linux where MariaDB is the default. This is a FEATURE REQUEST with a community signal of ≥2 upvotes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions