|
| 1 | +use api::error::VssError; |
| 2 | +use api::kv_store::KvStore; |
| 3 | +use api::types::{ |
| 4 | + DeleteObjectRequest, DeleteObjectResponse, GetObjectRequest, GetObjectResponse, |
| 5 | + ListKeyVersionsRequest, ListKeyVersionsResponse, PutObjectRequest, PutObjectResponse, |
| 6 | +}; |
| 7 | +use async_trait::async_trait; |
| 8 | +use std::io::Error; |
| 9 | + |
| 10 | +/// A [PostgreSQL](https://www.postgresql.org/) based backend implementation for VSS. |
| 11 | +pub struct PostgresBackendImpl {} |
| 12 | + |
| 13 | +impl PostgresBackendImpl { |
| 14 | + /// Constructs a [`PostgresBackendImpl`] using `dsn` for PostgreSQL connection information. |
| 15 | + pub async fn new(dsn: &str) -> Result<Self, Error> { |
| 16 | + todo!("pending implementation."); |
| 17 | + } |
| 18 | +} |
| 19 | + |
| 20 | +#[async_trait] |
| 21 | +impl KvStore for PostgresBackendImpl { |
| 22 | + async fn get( |
| 23 | + &self, user_token: String, request: GetObjectRequest, |
| 24 | + ) -> Result<GetObjectResponse, VssError> { |
| 25 | + todo!("pending implementation."); |
| 26 | + } |
| 27 | + |
| 28 | + async fn put( |
| 29 | + &self, user_token: String, request: PutObjectRequest, |
| 30 | + ) -> Result<PutObjectResponse, VssError> { |
| 31 | + todo!("pending implementation."); |
| 32 | + } |
| 33 | + |
| 34 | + async fn delete( |
| 35 | + &self, user_token: String, request: DeleteObjectRequest, |
| 36 | + ) -> Result<DeleteObjectResponse, VssError> { |
| 37 | + todo!("pending implementation."); |
| 38 | + } |
| 39 | + |
| 40 | + async fn list_key_versions( |
| 41 | + &self, user_token: String, request: ListKeyVersionsRequest, |
| 42 | + ) -> Result<ListKeyVersionsResponse, VssError> { |
| 43 | + todo!("pending implementation."); |
| 44 | + } |
| 45 | +} |
0 commit comments