sqlite-parser/src/main.rs

15 lines
387 B
Rust
Raw Normal View History

2020-12-01 10:04:41 -05:00
use sqlite_parser::{error::Error, header::parse_header};
use std::fs::read;
fn main() -> Result<(), Error> {
// first, read in all the bytes of our file
// using unwrap to just panic if this fails
2020-12-01 10:04:41 -05:00
let contents = read("data.sqlite").expect("Failed to read data.sqlite");
2020-12-01 10:04:41 -05:00
let db_header = parse_header(&contents[0..100])?;
2020-12-01 10:04:41 -05:00
println!("{:#?}", db_header);
Ok(())
}