start working on async queries

This commit is contained in:
Ayrat Badykov 2022-07-17 10:13:45 +03:00
parent f999e55fa4
commit a707ce2f5c
No known key found for this signature in database
GPG key ID: EC1148A46811EFB5
5 changed files with 17 additions and 0 deletions

View file

@ -22,3 +22,5 @@ typetag = "0.2"
log = "0.4"
serde = { version = "1", features = ["derive"] }
thiserror = "1.0"
bb8-postgres = "0.8"
tokio = { version = "1.20", features = ["full"] }

11
src/asynk/async_queue.rs Normal file
View file

@ -0,0 +1,11 @@
use bb8_postgres::tokio_postgres::Client;
pub struct AsyncQueue {
pg_client: Client,
}
impl AsyncQueue {
pub fn new(pg_client: Client) -> Self {
Self { pg_client }
}
}

1
src/asynk/mod.rs Normal file
View file

@ -0,0 +1 @@
pub mod async_queue;

View file

@ -0,0 +1 @@
INSERT INTO "fang_tasks" ("metadata", "error_message", "state", task_type") VALUES ($1, $2, $3, $4);

View file

@ -25,3 +25,5 @@ pub use typetag;
pub mod sync;
pub use sync::*;
pub mod asynk;