feat: load task to database
This commit is contained in:
parent
1e3c235b78
commit
7be435332c
5 changed files with 89 additions and 38 deletions
|
|
@ -2,7 +2,7 @@ use std::fs::File;
|
|||
use clap::Parser;
|
||||
use readwise_bulk_upload::config::Args;
|
||||
use readwise_bulk_upload::readwise::DocumentPayload;
|
||||
use readwise_bulk_upload::sql::get_database;
|
||||
use readwise_bulk_upload::sql::{TaskManager};
|
||||
use readwise_bulk_upload::{Error, Result};
|
||||
|
||||
#[tokio::main]
|
||||
|
|
@ -17,7 +17,9 @@ async fn main() -> Result<()> {
|
|||
|
||||
let documents: Vec<DocumentPayload> = serde_json::from_reader(file)?;
|
||||
|
||||
let db = get_database().await?;
|
||||
let task_manager = TaskManager::new().await?;
|
||||
|
||||
task_manager.load_tasks(documents).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue