5 ms·
Is there anything like this for MySQL?
by g_delgado14 5y ago
Is there anything like this for MySQL?
- redis_mlc 5y agoUnlikely, MySQL does not have transactional DDL (like CREATE TABLE). It's not a big loss when managing production databases in practice because with large tables you roll forward, but it would be nice for dev/qa environments. https://dev.mysql.com/doc/refman/8.0/en/cannot-roll-back.html https://dev.mysql.com/doc/refman/8.0/en/cannot-roll-back.htm... Source: DBA.
- hardwaresofton 5y agoYou could run MySQL in a container? Start a container per test-run and create a database per test or test suite. If your code is written well, you'll be able to change the database that your DAO/ORM/Query-layer runs on quite simply, and execute/ensure migrations from code.
- abraae 5y agoAs sibling says, run mysql in a container. Configure the container without any attached volumes, so that the data is stored in the container itself. Run your setup scripts, and get the database the way you want it. Now commit the changes to the container, to create a new container. Now you can spin up the new container, and your setup data will be already loaded within it.