Struct oxidized_mdf::MdfDatabase[][src]

pub struct MdfDatabase { /* fields omitted */ }

Implementations

impl MdfDatabase[src]

pub async fn open<P>(p: P) -> Result<Self, Error> where
    P: AsRef<Path>, 
[src]

pub async fn from_read(read: Box<dyn Read + Unpin>) -> Result<Self, Error>[src]

pub fn database_name(&self) -> &str[src]

pub fn table_names(&self) -> Vec<String>[src]

Returns the table names of this database file.

let db = MdfDatabase::open("data/AWLT2005.mdf").await.unwrap();
let table_names = db.table_names();
assert!(table_names.contains(&String::from("Customer")));

pub fn column_names(&self, table_name: &str) -> Option<Vec<String>>[src]

Returns the column names of the given table name.

let db = MdfDatabase::open("data/AWLT2005.mdf").await.unwrap();

let column_names = db.column_names("Address").unwrap();
assert!(column_names.contains(&String::from("City")));

pub fn rows<'a, 'b: 'a>(
    &'b mut self,
    table_name: &str
) -> Option<impl Stream<Item = Row> + 'a>
[src]

Returns a stream of the rows in the given table.

use oxidized_mdf::{MdfDatabase, Value};
use async_std::stream::StreamExt;

let mut db = MdfDatabase::open("data/AWLT2005.mdf").await.unwrap();
let mut rows = db.rows("Address").unwrap();
let first_row = rows.next().await.unwrap();

assert_eq!(
    first_row.value("AddressLine1").cloned(),
    Some(Value::String(String::from("8713 Yosemite Ct.")))
);

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Tap for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.