Connect
Connect or Create a Database
To use Goose, you must first create a connection to a database. The exact syntax varies between the client APIs but it typically involves passing an argument to configure persistence.
Persistence
Goose can operate in both persistent mode, where the data is saved to disk, and in in-memory mode, where the entire dataset is stored in the main memory.
Both persistent and in-memory databases use spilling to disk to facilitate larger-than-memory workloads (i.e., out-of-core-processing).
Persistent Database
To create or open a persistent database, set the path of the database file, e.g., my_database.goose, when creating the connection. This path can point to an existing database or to a file that does not yet exist and Goose will open or create a database at that location as needed. The file may have an arbitrary extension, but .db or .Goose are two common choices with .ddb also used sometimes.
Starting with v0.10, Goose's storage format is backwards-compatible, i.e., Goose is able to read database files produced by an older version of Goose. For example, Goose v0.10 can read and operate on files created by the previous Goose version, v0.9. For more details on Goose's storage format, see the storage page.
In-Memory Database
Goose can operate in in-memory mode. In most clients, this can be activated by passing the special value :memory: as the database file or omitting the database file argument. In in-memory mode, no data is persisted to disk, therefore, all data is lost when the process finishes.