go-mysql-server
A MySQL-compatible relational database with a storage agnostic query engine. Implemented in Go.
What is go-mysql-server?
A MySQL-compatible relational database with a storage agnostic query engine. Implemented in Go.
Overview of go-mysql-server
What it is
go-mysql-server is a MySQL-compatible relational database engine implemented in Go. It provides a data-source agnostic SQL engine and server that runs queries on user-provided data sources using the MySQL dialect and wire protocol. The project includes a simple in-memory database implementation for testing, and allows querying any data source by implementing custom backends. The most complete real-world implementation is Dolt, a SQL database with Git-style versioning.
Key features
- Data-source agnostic: queries can run on any backend that implements the provided interfaces.
- Includes an in-memory database backend suitable for use in tests.
- Drop-in replacement for MySQL with most client libraries, tools, and SQL syntax (with specific limitations).
- Supports ICU-compatible regular expressions via a Cgo dependency on ICU4C, or a pure Go regex implementation using the build tag
gms_pure_go. - Used in production by Dolt, a SQL database with Git-style versioning.
Use cases
- Stand-in for MySQL in Go test environments, using the built-in
memorydatabase implementation. - Providing SQL access to arbitrary data sources by implementing a handful of interfaces.
Getting started
Add go-mysql-server as a dependency to your Go project: go get github.com/dolthub/go-mysql-server@latest For ICU-compatible regex, ensure a C/C++ toolchain and libicu-dev are available. To use the pure Go regex implementation, compile with -tags=gms_pure_go. A complete example of starting an in-memory server is provided in the _example directory of the repository.
License and pricing
Licensed under Apache-2.0. The project is open source and free to use.
Based on the project's public README and repository metadata.