check_wal_level

Function check_wal_level 

Source
pub async fn check_wal_level(client: &Client) -> Result<String>
Expand description

Check the wal_level setting on the target database

Queries the current wal_level configuration parameter. For logical replication (subscriptions), wal_level must be set to logical.

§Arguments

  • client - Connected PostgreSQL client

§Returns

Returns the current wal_level setting as a String (e.g., “replica”, “logical”).

§Errors

This function will return an error if the database query fails.

§Examples

let client = connect("postgresql://user:pass@localhost:5432/mydb").await?;
let wal_level = check_wal_level(&client).await?;
assert_eq!(wal_level, "logical");