/// Try to write lineprotocol data and return all tables that where written.
Try to write lineprotocol data and return all tables that where written.
Try to write lineprotocol data and return all tables that where written .
pub fn try_write_lp(db: &Db, lp: &str) -> Result<Vec<String>> {
        let entries = lp_to_entries(lp);
        let mut tables = HashSet::new();
        for entry in &entries {
            if let Some(writes) = entry.partition_writes() {
                for write in writes {
                    for batch in write.table_batches() {
                        tables.insert(batch.name().to_string());
                    }
                }
            }
        }
        entries
            .into_iter()
            .try_for_each(|entry| db.store_entry(entry))?;
        let mut tables: Vec<_> = tables.into_iter().collect();
        tables.sort();
        Ok(tables)
    }
pub fn try_write_lp ( db : & Db , lp : & str ) -> Result < Vec < String > > { let entries = lp_to_entries ( lp ) ; let mut tables = HashSet :: new ( ) ; for entry in & entries { if let Some ( writes ) = entry . partition_writes ( ) { for write in writes { for batch in write . table_batches ( ) { tables . insert ( batch . name ( ) . to_string ( ) ) ; } } } } entries . into_iter ( ) . try_for_each ( | entry | db . store_entry ( entry ) ) ? ; let mut tables : Vec < _ > = tables . into_iter ( ) . collect ( ) ; tables . sort ( ) ; Ok ( tables ) }
Try to write lineprotocol data and return all tables that where written.
Try to write lineprotocol data and return all tables that where written .
db
&Db
lp
&str