diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/insert.rs | 2 | ||||
| -rw-r--r-- | src/yaml.rs | 8 | 
2 files changed, 4 insertions, 6 deletions
| diff --git a/src/insert.rs b/src/insert.rs index f58fc4c..9c15fc7 100644 --- a/src/insert.rs +++ b/src/insert.rs @@ -9,7 +9,7 @@ pub fn insert(      for mut doc in data {          let tx = dbconn.transaction()?; -        crate::yaml::extract(&mut doc, &tx, &table_name, &table_columns)?; +        crate::yaml::db_insert(&mut doc, &tx, &table_name, &table_columns)?;          tx.commit()?;      } diff --git a/src/yaml.rs b/src/yaml.rs index ed64afd..c8840bf 100644 --- a/src/yaml.rs +++ b/src/yaml.rs @@ -12,10 +12,8 @@ pub(crate) use sql::*;  pub use write::*; -// TODO: Separate functions to get a list of YAML hashes, and insert hashes into -// the database. -/// TODO -pub fn extract( +/// Insert a YAML document into the given table in the database. +pub fn db_insert(      doc: &mut yaml::Yaml,      tx: &rusqlite::Transaction,      table_name: &str, @@ -24,7 +22,7 @@ pub fn extract(      match doc {          yaml::Yaml::Array(ref mut array) => {              for yaml_value in array { -                extract(yaml_value, tx, table_name, table_columns)?; +                db_insert(yaml_value, tx, table_name, table_columns)?;              }          }          yaml::Yaml::Hash(ref mut hash) => { | 
