load data-container
#
OverviewLoading a data container allows you to run your data container (database) with the data saved at a moment in time.
#
Command#
TutorialIn this tutorial we will create a data image, then create a data container from that image. We will then make some changes to the data container and save those changes. After this we will load the previous revision and inspect the data container.
As a prerequisite you should've followed the instructions to install spawnctl
Create a file
development.yaml
with your data image specifications.In this case we want to create a PostgreSQL data image that is completely empty and is named
dev
.Run the following command to create a data image.
You can verify your data image by running the following command.
Create a data container from the newly created data image.
You can verify your data container was properly created by running the following command.
Notice the created data container has revision
rev.0
.You should now be able to connect to your database and execute queries.
In this example we connect to the PostgreSQL data container (database) using psql.
We can now perform a save operation on this data container.
You can now load the data container at revision
rev.0
.Notice that your existing data container now has revision
rev.0-ciys.0
You can now connect to this data container (database) and verify its content.
Notice that there are no relations even though our data container at revision
rev.1
had one tablecustomers
.