Skip to content

Commit

Permalink
databases: in-memory SQLite
Browse files Browse the repository at this point in the history
vindarel committed Nov 12, 2024
1 parent 870934d commit bb946be
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions databases.md
Original file line number Diff line number Diff line change
@@ -106,6 +106,22 @@ You might make good use of a wrapper function:
(mito:connect-toplevel :sqlite3 :database-name "myapp"))
~~~

### Connecting to an in-memory DB (SQLite)

To connect to a `sqlite3` in-memory database, you use the ":memory:"
string as the DB name. It has a special meaning for SQLite.

~~~lisp
(mito:connect-toplevel :sqlite3 :database-name ":memory:")
~~~

This doesn't create a file on disk, and the DB will be even
faster. But you'll loose all the data when you close the
connection. It is consequently specially useful for unit-tests, to
load data for temporary analytics, etc.

You can read more about [in-memory SQLite databases here](https://www.sqlite.org/inmemorydb.html).

### Models

#### Defining models

0 comments on commit bb946be

Please sign in to comment.