How to - Resetting a data container
When developing new features or trying to recreate issues with a database involved, returning the database to its starting point is often time consuming and challenging. Using Spawn data containers you can quickly and easily reset your data container, returning it to its starting state, including data and schema changes.
Spawn is currently in open beta. Complete the installation instructions to get access.
This is part of a series of short guides for getting up and running quickly with Spawn.
#Create and connect to a data container
To explore the reset command, we first need a data container. If you don't have a data container available, you can follow this guide.
This example uses an empty PostgeSQL data container, but you can follow along with any type by modifying the connection and queries accordingly. Connect to your data container and examine the current state by finding out which tables exist. Connect using whatever tool you would normally for the database engine type you are working with.
In this case, the data container is empty so no tables exist.
#Modify your data container
Make a modification to the data container, in this example using the same session as the previous step.
There is now a table created in the data container that wasn't present when it was first created.
#Reset your data container
To return the data container to its initial state without modifications, run the reset command.
You can now reconnect to the data container (the connection details remain the same but the previous connection will have been terminated) and verify that it has returned to its initial state.
#Using your data container
Now you are able to create and reset data containers, other advanced actions are available such as save, graduate and load.