mtparser

Package Version Hex Docs

Parser for MySQL mysqltest / MariaDB mariadb-test test files (.test / .inc), written in Gleam.

Gleam rewrite of the Rust/winnow version (mtparser-rs). New architecture: mysqltest syntax is line-oriented, so instead of a combinator parser the new parser runs in three explicit stages — split into lines, classify each line, parse arguments within the line — with parser state (delimiter) threaded through plain function calls. The command set is the union of all supported MySQL/MariaDB versions (maximum compatibility, no version gating).

Status

Early rewrite in progress. Working: three-stage parse flow — echo, assert, cat_file, append_file (block command with end markers), comments, blank lines, SQL statements, and $variable interpolation.

Development

gleam test                          # run tests (Erlang target)
gleam test --target javascript      # run tests (JS target)
gleam build --target javascript     # build for npm consumption later
✨ Search Document