Module db

Module db 

Source
Expand description

§Note on database migrations

The user_version field in the database SQLite header is used to keep track of the database version. It starts with 0, which means no tables exist yet, and is incremented everytime a migration is applied. In turn, migrations are named after their version numbers, so the first migration is 1.sql, the second one is 2.sql and so on.

The database schema is contained within the first migration. See version, bump and migrate for how this works.

Structs§

Database
A file-backed database storing information about the network.

Enums§

Error
JournalMode
Database journal mode.

Functions§

bump
Bump the user_version value.
migrate
Migrate the database to the latest schema.
version
Get the user_version value from the database header.