SQLite compilation setup
The view server uses SQLite via
sqlx as its backing store. The type-safe
query macros require compile-time information about the database schemas.
Normally, this information is cached in the crate’s
nothing extra is required to build.
However, when editing the view server’s database code, it’s necessary to work with a development database:
sqlx-cliinstalled with the correct features:
cargo install sqlx-cli --features sqlite
The database structure is defined in the
migrations/directory of the
DATABASE_URLenvironment variable to point to the SQLite location. For instance,
will set the shell environment variable to the same one set in the project’s
cargo sqlx database setupto create the database and run migrations.
cargo sqlx prepare -- --libto regenerate the
sqlx-data.jsonfile that allows offline compilation.