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

Dump data to file #2830

Closed
pjebs opened this issue Jan 26, 2025 · 7 comments
Closed

Dump data to file #2830

pjebs opened this issue Jan 26, 2025 · 7 comments

Comments

@pjebs
Copy link

pjebs commented Jan 26, 2025

Is there a way to dump the in-memory data to file and load it back up later?

@timsehn
Copy link
Contributor

timsehn commented Jan 27, 2025

You can connect a mysqldump to a server you are running (as long as it is not embedded) and dump the database.

@timsehn timsehn closed this as completed Jan 27, 2025
@pjebs
Copy link
Author

pjebs commented Jan 27, 2025

I'm trying to embed the database.

@timsehn
Copy link
Contributor

timsehn commented Jan 27, 2025

You need to start a server on a port then. go-mysql-server provides this interface.

@pjebs
Copy link
Author

pjebs commented Jan 27, 2025

How hard would it be to just save the binary of what ever is stored in memory?

@pjebs
Copy link
Author

pjebs commented Jan 27, 2025

Or would sqlite be what I'm really after?

@timsehn
Copy link
Contributor

timsehn commented Jan 27, 2025

Not that hard but we never got around to it. We would take a contribution:

#2428

@pjebs
Copy link
Author

pjebs commented Jan 30, 2025

Is there a single struct somewhere in the memory package that contains all the data?

I should be able to use the encode/gob package to save the entire struct as binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants