Expand description
Database support
Modules§
- application_
migration_ set - This module defines the migrations to apply to the application database
- node_
migration_ set - This module defines the migrations to apply to the application database
- sqlite
- SQLite rust migrations
Macros§
- retry
- This macro wraps a function with retry calls to keep calling the function until the error “database is locked” is not raised anymore.
Structs§
- Auto
Retry - Wrapper for an auto-retried struct
- Boolean
- This type is used to map boolean fields for the types deriving
FrowRow. Postgres provides a proper boolean type but SQLite maps them as integers. - Database
User - User of the Postgres database
- Migrator
- Migrator is responsible for running Sql and Rust migrations side by side in the correct order, checking for conflicts, duplicates; making sure each migration runs only once
- Nullable
- This type is used to map Option
fields for the types deriving FromRow - Sqlx
Database - The SqlxDatabase struct is used to create a database:
Enums§
- Database
Configuration - Configuration for the database. We either use Sqlite or Postgres
- Database
Type - Type of database
Constants§
- OCKAM_
DATABASE_ CONNECTION_ URL - Database connection URL
- OCKAM_
SQLITE_ IN_ MEMORY - Use an in-memory SQLite database
Traits§
- From
Sqlx Error - This trait provides some syntax for transforming sqlx errors into ockam errors
- Migration
Set - This trait runs migrations on a given database
- Rust
Migration - Individual rust migration
- ToVoid
- This trait provides some syntax to shorten queries execution returning ()
Functions§
- create_
temp_ db_ file - Create a temporary database file that won’t be cleaned-up automatically
- skip_
if_ postgres - This function can be used to avoid running a test if the postgres database is used.
- with_
application_ dbs - This function can be used to run some test code with the 3 different databases implementations of the application database
- with_
dbs - This function can be used to run some test code with the 3 different databases implementations
- with_
postgres - This function can be used to run some test code with a postgres database
- with_
sqlite_ dbs - This function can be used to run some test code with the 2 SQLite databases implementations