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

Augment testing with an in-process MySQL server #126

Open
jonhoo opened this issue Dec 14, 2017 · 2 comments
Open

Augment testing with an in-process MySQL server #126

jonhoo opened this issue Dec 14, 2017 · 2 comments

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Dec 14, 2017

Over the past couple of days, I've written up a library for emulating a MySQL server. It essentially implements the "other side" of the MySQL network protocol, and delegates handling of queries to a user-defined backend (also implemented in Rust). I found the mysql crate super helpful in working out its kinks, and I re-use code from mysql_common wherever possible.

The crate works fairly well at this point, and even self-tests by using this crate to connect to itself, and then running a bunch of queries (see tests starting from here). It occurred to me that this might also help test the mysql crate without relying on an externally-running MySQL DB. Feel free to close if you don't think it's a good idea.

@0xpr03
Copy link
Contributor

0xpr03 commented Sep 1, 2018

Just a note that you probably want to run tests against a real mariadb/mysql instance, to get real-world feedback from all of their quirks.

@Kinrany
Copy link

Kinrany commented Oct 6, 2021

It would be cool to run a query against a real database, save the response, and then use a fake in-process database to run tests without spinning up a real database every time.

Doing this at the driver level means that all higher level libraries like diesel and sqlx can share the implementation.

serprex pushed a commit to serprex/rust-mysql-simple that referenced this issue Feb 10, 2025
Expose a flags() method on RowsEventData to read corresponding event flags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants