configure_db

Function configure_db 

Source
pub async fn configure_db(
    tables_config: &mut ConfigMap,
    datatypes_config: &mut ConfigMap,
    pool: &AnyPool,
    parser: &StartParser,
    verbose: bool,
    command: &ValveCommand,
) -> Result<(Vec<String>, ConfigMap), Error>
Expand description

Given config maps for tables and datatypes, a database connection pool, and a StartParser, read in the TSV files corresponding to the tables defined in the tables config, and use that information to fill in constraints information into a new config map that is then returned along with a list of the tables in the database sorted according to their mutual dependencies. If the flag verbose is set to true, emit SQL to create the database schema to STDOUT. If command is set to ValveCommand::Create, execute the SQL statements to create the database using the given connection pool. If it is set to ValveCommand::Load, execute the SQL to load it as well.