chore: first commit
This commit is contained in:
commit
1d5a517395
13 changed files with 2396 additions and 0 deletions
23
src/main.rs
Normal file
23
src/main.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use std::fs::File;
|
||||
use clap::Parser;
|
||||
use readwise_bulk_upload::config::Args;
|
||||
use readwise_bulk_upload::readwise::Document;
|
||||
use readwise_bulk_upload::sql::get_database;
|
||||
use readwise_bulk_upload::{Error, Result};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let args = Args::parse();
|
||||
|
||||
let file = File::open(args.path())
|
||||
.map_err(|_| Error::Runtime(format!(
|
||||
r#"The file "{}" could not be open"#,
|
||||
args.path().display()
|
||||
)))?;
|
||||
|
||||
let documents: Vec<Document> = serde_json::from_reader(file)?;
|
||||
|
||||
let db = get_database().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue