rust-mysql-simple
                                
                                 rust-mysql-simple copied to clipboard
                                
                                    rust-mysql-simple copied to clipboard
                            
                            
                            
                        Augment testing with an in-process MySQL server
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.
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.
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.