5 configuration options · available in Rust, Python, Node.js, Java
use opendal::Operator;
let op = Operator::via_iter("postgresql", [
])?;
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.
| Key | Type | Required | Description |
|---|---|---|---|
root | string | no | Root of this backend.
All operations will happen under this root.
Default to / if not set. |
connection_string | string | no | 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>. |
table | string | no | the table of postgresql |
key_field | string | no | the key field of postgresql |
value_field | string | no | the value field of postgresql |