You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implements MySQL/MariaDB as a production database backend alongside
SQL Server and SQLite. Uses go-sql-driver/mysql with FormatDSN for
connection management, batched session configuration via multiStatements,
and @PARAM to ? positional placeholder translation.
Driver (internal/db/mysql.go):
- Implement MySQLDriver with full Driver interface (Query, Ping, Reconnect, Close)
- Build DSN using mysql.Config{}.FormatDSN() for safe credential handling
- Translate @PARAM syntax to ? positional placeholders
- Batch session SET statements into single round-trip (multiStatements=true)
- Use ceiling division for lock_timeout_ms to seconds conversion
- Configure connection pool with sensible defaults (5 open, 2 idle, 5min lifetime)
- Support TLS via encrypt config field (true, false, disable, skip-verify)
Config and Validation:
- Add "mysql" to ValidDatabaseTypes map
- Add MySQL-specific validation (host, port, user, password, database required)
- Reject "snapshot" isolation level for MySQL (SQL Server-specific)
- Make DefaultSessionConfig database-type-aware (MySQL defaults to read_committed)
- Update error messages to include "mysql" in valid types list
- Update OpenAPI spec description for database type field
CI:
- Add test-mysql job with MySQL 8.0 service container
- Gate test-mysql on main test job (needs: [test])
- Validate MySQL example configs in CI with running MySQL instance
Examples:
- Reorganize examples/ into sqlite/ and mysql/ subdirectories
- Add examples/mysql/01-basic.yaml demonstrating MySQL connection and queries
- Update Makefile validate-examples to use examples/sqlite/ path
Tests:
- Add unit tests for DSN construction, query translation, isolation mapping, pool config
- Add integration tests for queries, params, concurrency, unicode, reconnect
- Add TestValidateDatabase_MySQL for field and isolation validation
- Update TestValidDatabaseTypes, TestLoad_InvalidDatabaseType, TestValidateDatabase_InvalidType
- Update TestDatabaseConfig_DefaultSessionConfig with per-type cases
Documentation:
- Add MySQL safety table, user setup, configuration options, session settings
- Add MySQL query syntax examples and operational considerations
- Update session settings table, pagination notes, troubleshooting section
- Mark MySQL as complete in roadmap
A lightweight, production-grade Go service that exposes predefined SQL queries as HTTP endpoints. Supports **SQL Server** and **SQLite** databases. Runs as a system service on **Windows**, **Linux**, and **macOS** with **zero impact on the source database** and **zero maintenance** requirements.
3
+
A lightweight, production-grade Go service that exposes predefined SQL queries as HTTP endpoints. Supports **SQL Server**, **MySQL**, and **SQLite** databases. Runs as a system service on **Windows**, **Linux**, and **macOS** with **zero impact on the source database** and **zero maintenance** requirements.
4
4
5
5
## Features
6
6
7
-
-**Multi-Database Support** - SQL Server and SQLite (same query syntax)
Pagination is handled at the query level using database-native syntax. This is more efficient than service-level truncation because the database stops scanning once the limit is reached.
633
724
634
-
> **Note:** SQL Server uses `TOP`, SQLite uses `LIMIT`. Write queries for your specific database type.
725
+
> **Note:** SQL Server uses `TOP`, MySQL and SQLite use `LIMIT`. Write queries for your specific database type.
- Verify TLS settings match server configuration (`encrypt: "true"` or `"skip-verify"`)
2597
+
- Check `max_connections` on MySQL server if getting connection pool exhaustion
2598
+
2485
2599
### Database issues (SQLite)
2486
2600
2487
2601
**"database is locked" errors:**
@@ -2710,7 +2824,7 @@ All unit and integration tests use SQLite in-memory databases (`:memory:`) to av
2710
2824
2711
2825
Planned features for future releases:
2712
2826
2713
-
-[]**MySQL Support** - Add MySQL/MariaDB as a database backend option alongside SQL Server and SQLite.
2827
+
-[x]**MySQL Support** - Add MySQL/MariaDB as a database backend option alongside SQL Server and SQLite.
2714
2828
-[ ]**PostgreSQL Support** - Add PostgreSQL as a database backend option.
2715
2829
-[ ]**TLS Support** - Native HTTPS termination without requiring a reverse proxy (Caddy/nginx). Will support configurable certificate paths and automatic Let's Encrypt integration.
2716
2830
-[x]**Rate Limiting** - Per-endpoint and per-client rate limiting to protect database resources from excessive requests.
0 commit comments