Skip to main content

postgresql

5 configuration options · available in Rust, Python, Node.js, Java

Quick start
use opendal::Operator;

let op = Operator::via_iter("postgresql", [
])?;
All configuration options (copy & trim)
Full reference
use opendal::Operator;

let op = Operator::via_iter("postgresql", [
// Root of this backend.
//
// All operations will happen under this root.
//
// Default to `/` if not set.
// ("root".to_string(), "...".to_string()),

// The URL should be with a scheme of either `postgres://` or `postgresql://`.
//
// - `postgresql://user@localhost`
// - `postgresql://user:password@%2Fvar%2Flib%2Fpostgresql/mydb?connect_timeout=10`
// - `postgresql://user@host1:1234,host2,host3:5678?target_session_attrs=read-write`
// - `postgresql:///mydb?user=user&host=/var/lib/postgresql`
//
// For more information, please visit <https://docs.rs/sqlx/latest/sqlx/postgres/struct.PgConnectOptions.html>.
// ("connection_string".to_string(), "...".to_string()),

// the table of postgresql
// ("table".to_string(), "...".to_string()),

// the key field of postgresql
// ("key_field".to_string(), "...".to_string()),

// the value field of postgresql
// ("value_field".to_string(), "...".to_string()),

])?;

Every option is passed as a string key; OpenDAL parses it into the right type. Some services may require building the binding with the matching services-* feature enabled.

Configuration reference

General5
KeyTypeRequiredDescription
rootstringnoRoot of this backend. All operations will happen under this root. Default to / if not set.
connection_stringstringnoThe URL should be with a scheme of either postgres:// or postgresql://. - postgresql://user@localhost - postgresql://user:password@%2Fvar%2Flib%2Fpostgresql/mydb?connect_timeout=10 - postgresql://user@host1:1234,host2,host3:5678?target_session_attrs=read-write - postgresql:///mydb?user=user&host=/var/lib/postgresql For more information, please visit <https://docs.rs/sqlx/latest/sqlx/postgres/struct.PgConnectOptions.html>.
tablestringnothe table of postgresql
key_fieldstringnothe key field of postgresql
value_fieldstringnothe value field of postgresql