Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: persistent database store #2428

Open
jonahzheng opened this issue Apr 1, 2024 · 1 comment
Open

Feature request: persistent database store #2428

jonahzheng opened this issue Apr 1, 2024 · 1 comment
Labels
customer issue enhancement New feature or request

Comments

@jonahzheng
Copy link

go-mysql-server, how to save data to hard disk?

@zachmu
Copy link
Member

zachmu commented Apr 2, 2024

Hi @jonahzheng,

There is no persistent database implementation built into the package. The provided memory implementation only persists in memory for a single process's lifetime. You would need to implement a persistent version to get this functionality.

We would take this contribution as a patch if you wanted to write it. A first attempt would probably extend the memory.Database and serialize table schemas as CREATE TABLE statements, and table data as CSV or JSON. Happy to provide additional pointers if you or someone else want to attempt this.

Alternately, you could build on top of Dolt, which is MySQL compatible and uses go-mysql-server as its query layer. Then you get persistence for free.

https://github.com/dolthub/dolt

Depending on what you're trying to do, the driver package might be a more convenient way to build on top of Dolt:

https://github.com/dolthub/driver

@zachmu zachmu changed the title how persistent store? Feature request: persistent database store Apr 2, 2024
@zachmu zachmu added the enhancement New feature or request label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants