Function init_postgres
Source pub async fn init_postgres(
pg: &PgPool,
database: String,
password: String,
schema_dir: Option<String>,
) -> Result<()>
Expand description
Initializes the Postgres database by creating schema, roles, and executing SQL files from schema_dir
.
§Errors
Returns an error if any SQL execution or file system operation fails.
§Panics
Panics if schema_dir
is missing and cannot be determined or if other unwraps fail.