Module minerva_data::db
source · [−]Expand description
This module contains functions and structures related to handling the PostgreSQL database, specially regarding connections and database creation.
Modules
create 🔒
Functions
Generates a string to connect to PostgreSQL RDBMS, given a tenant name and
the database server endpoint (e.g.
localhost:5432
). This function
assumes a user postgres
with a password postgres
.Runs a database creation query, if said database does not exist.
The database in question shall have the same name of a tenant.
This function also expects the endpoint to a database server
(e.g.
localhost:5432
).Creates a connection pool to the PostgreSQL RDBMS, given a maximum number of
connections, and panics if the connections could not be established.
Creates a single connection to the PostgreSQL RDBMS, and panics if the
connection could not be established.
Attempts to generate a single connection to the PostgreSQL RDBMS, without
error checks. This could be used to perform connections and evaluate if they
could actually be established.
Type Definitions
Type representing a Diesel connection to a database.
Type representing a Diesel connection pool to a database.