sd44 commented on code in PR #3495: URL: https://github.com/apache/incubator-opendal/pull/3495#discussion_r1384266854
########## core/src/services/postgresql/backend.rs: ########## @@ -24,30 +24,61 @@ use std::sync::Arc; use async_trait::async_trait; use bb8::Pool; use bb8_postgres::PostgresConnectionManager; +use serde::Deserialize; use tokio::sync::OnceCell; use tokio_postgres::Config; use crate::raw::adapters::kv; use crate::raw::*; use crate::*; -/// [Postgresql](https://www.postgresql.org/) services support. -#[doc = include_str!("docs.md")] -#[derive(Default)] -pub struct PostgresqlBuilder { +/// Config for PostGresQL services support. +#[derive(Default, Deserialize)] +#[serde(default)] +#[non_exhaustive] +pub struct PostgresqlConfig { + /// root of this backend. + /// + /// All operations will happen under this root. + /// + /// default to `/` if not set. + pub root: Option<String>, + /// the connection string of postgres server connection_string: Option<String>, - + /// the table of postgresql table: Option<String>, + /// the key field of postgresql key_field: Option<String>, + /// the value field of postgresql value_field: Option<String>, - root: Option<String>, +} + +impl Debug for PostgresqlConfig { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + let mut d = f.debug_struct("PostgresqlConfig"); + + d.field("root", &self.root) + .field("connection_string", &self.connection_string) Review Comment: has fixed, pls check -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
