Creating and querying database snapshots
Last updated
Last updated
To provide data for the mock API to query, you create database snapshots. Fabricate stores the snapshot data internally.
To create a database snapshot of the current database data:
If no snapshots are currently configured, click Create a DB Snapshot.
If there are existing snapshots, then:
Click the snapshot dropdown.
In the dropdown, click Create New Snapshot.
On the Create DB Snapshot panel, in the Snapshot Name field, provide a name for the snapshot.
Fabricate provides a default value of v<snapshot count>
. For example, v1
or v2
.
Click Create Snapshot. Fabricate generates the snapshot and adds it to the dropdown list.
To verify the snapshot data works as expected, you can run queries against the snapshot.
To query a snapshot:
Click the snapshot dropdown.
In the dropdown list, select the snapshot to query against.
Click SQL.
On the SQL Editor panel, enter the query, then either:
Press Enter.
Click Run Query.
You can download a snapshot. The snapshot is downloaded to a file named <database name>.sqlite.
To download a snapshot:
Click the snapshot dropdown.
In the dropdown list, click the download icon for the snapshot.
To remove a snapshot:
Click the snapshot dropdown.
In the dropdown list, click the delete icon for the snapshot.