Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcmicu committed Jan 14, 2024
1 parent 2c06218 commit aacdac6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ pub async fn configure_db_old(
pool: &AnyPool,
parser: &StartParser,
verbose: bool,
command: &ValveCommand,
command: &ValveCommandOld,
) -> Result<(Vec<String>, SerdeMap), sqlx::Error> {
// This is the SerdeMap that we will be returning:
let mut constraints_config = SerdeMap::new();
Expand Down Expand Up @@ -957,7 +957,7 @@ pub async fn configure_db_old(
)
.0;

if *command != ValveCommand::Config || verbose {
if *command != ValveCommandOld::Config || verbose {
// Generate DDL for the history table:
let mut history_statements = vec![];
history_statements.push({
Expand Down Expand Up @@ -1044,7 +1044,7 @@ pub async fn configure_db_old(
tables_to_create.append(&mut sorted_tables.clone());
for table in &tables_to_create {
let table_statements = setup_statements.get(table).unwrap();
if *command != ValveCommand::Config {
if *command != ValveCommandOld::Config {
for stmt in table_statements {
sqlx_query(stmt)
.execute(pool)
Expand All @@ -1064,7 +1064,7 @@ pub async fn configure_db_old(

/// Various VALVE commands, used with [valve()](valve).
#[derive(Debug, PartialEq, Eq)]
pub enum ValveCommand {
pub enum ValveCommandOld {
/// Configure but do not create or load.
Config,
/// Configure and create but do not load.
Expand All @@ -1076,7 +1076,7 @@ pub enum ValveCommand {
/// 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]).
/// optionally create and/or load it according to the value of `command` (see [ValveCommandOld]).
/// If the `verbose` flag is set to true, output status messages while loading. If `config_table`
/// is given and `table_table` indicates a database, query the table called `config_table` for the
/// table table information. Returns the configuration map as a String. If `initial_load` is set to
Expand All @@ -1086,7 +1086,7 @@ pub enum ValveCommand {
pub async fn valve_old(
table_table: &str,
database: &str,
command: &ValveCommand,
command: &ValveCommandOld,
verbose: bool,
initial_load: bool,
config_table: &str,
Expand Down Expand Up @@ -1122,7 +1122,7 @@ pub async fn valve_old(
.max_connections(5)
.connect_with(connection_options)
.await?;
if *command == ValveCommand::Load && pool.any_kind() == AnyKind::Sqlite {
if *command == ValveCommandOld::Load && pool.any_kind() == AnyKind::Sqlite {
sqlx_query("PRAGMA foreign_keys = ON")
.execute(&pool)
.await?;
Expand Down Expand Up @@ -1186,7 +1186,7 @@ pub async fn valve_old(
let compiled_rule_conditions =
get_compiled_rule_conditions(&config, compiled_datatype_conditions.clone(), &parser);

if *command == ValveCommand::Load {
if *command == ValveCommandOld::Load {
if verbose {
eprintln!(
"{} - Processing {} tables.",
Expand Down

0 comments on commit aacdac6

Please sign in to comment.