Expand description
Modules§
Structs§
- Column
Rule - Represents a ‘when-then’ condition, as found in the
ruletable, as two CompiledCondition structs corresponding to the when and then parts of the given rule. - Compiled
Condition - Represents a condition in three different ways: (i) in String format, (ii) as a parsed Expression, and (iii) as a pre-compiled regular expression.
- Parsed
Structure - Represents a structure such as those found in the
structurecolumn of thecolumntable in both its parsed format (i.e., as an Expression) as well as in its original format (i.e., as a plain String).
Enums§
- Valve
Command - Various VALVE commands, used with valve().
Functions§
- configure_
db - 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
verboseis set to true, emit SQL to create the database schema to STDOUT. Ifcommandis 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. - get_
compiled_ datatype_ conditions - Given the global configuration map and a parser, compile all of the datatype conditions, add them to a hash map whose keys are the text versions of the conditions and whose values are the compiled conditions, and then finally return the hash map.
- get_
compiled_ rule_ conditions - Given the global config map, a hash map of compiled datatype conditions (indexed by the text version of the conditions), and a parser, compile all of the rule conditions, add them to a hash which has the following structure:
- get_
parsed_ structure_ conditions - Given the global config map and a parser, parse all of the structure conditions, add them to a hash map whose keys are given by the text versions of the conditions and whose values are given by the parsed versions, and finally return the hashmap.
- insert_
new_ row - Given a global config map, a database connection pool, a table name, and a row, assign a new row number to the row and insert it to the database, then return the new row number.
- read_
config_ files - Given the path to a configuration table (either a table.tsv file or a database containing a table named “table”), load and check the ‘table’, ‘column’, and ‘datatype’ tables, and return ConfigMaps corresponding to specials, tables, datatypes, and rules.
- update_
row - Given global config map, a database connection pool, a table name, a row, and the row number to
update, update the corresponding row in the database with new values as specified by
row. - valve
- Given a path to a configuration table (either a table.tsv file or a database containing a
table named “table”), and a directory in which to find/create a database: configure the
database using the configuration which can be looked up using the table table, and
optionally create and/or load it according to the value of
command(see ValveCommand). If theverboseflag is set to true, output status messages while loading. Ifconfig_tableis given andtable_tableindicates a database, query the table calledconfig_tablefor the table table information. Returns the configuration map as a String.
Type Aliases§
- Config
Map - An alias for serde_json::Map<String, serde_json::Value>.