#postgresql #database-server #postgresql-embedded #server

postgresql_commands

PostgreSQL commands for interacting with a PostgreSQL server

42 releases

Uses new Rust 2024

0.20.2 Feb 22, 2026
0.20.0 Aug 31, 2025
0.19.0 Jun 24, 2025
0.18.2 Mar 21, 2025
0.14.2 Jul 17, 2024

#404 in Database interfaces

Download history 14099/week @ 2025-12-20 11681/week @ 2025-12-27 33673/week @ 2026-01-03 43747/week @ 2026-01-10 26767/week @ 2026-01-17 35298/week @ 2026-01-24 40729/week @ 2026-01-31 43712/week @ 2026-02-07 39541/week @ 2026-02-14 41961/week @ 2026-02-21 60904/week @ 2026-02-28 72152/week @ 2026-03-07 68246/week @ 2026-03-14 70431/week @ 2026-03-21 78166/week @ 2026-03-28 98541/week @ 2026-04-04

332,524 downloads per month
Used in 26 crates (4 directly)

(Apache-2.0 OR MIT) AND PostgreSQL

420KB
12K SLoC

PostgreSQL Commands

ci Documentation Code Coverage Latest version License Semantic Versioning

A library for executing PostgreSQL command line utilities.

Examples

use postgresql_commands::Result;
use postgresql_commands::psql::PsqlBuilder;

fn main() -> Result<()> {
    let psql = PsqlBuilder::new()
        .command("CREATE DATABASE \"test\"")
        .host("127.0.0.1")
        .port(5432)
        .username("postgresql")
        .pg_password("password")
        .build();

    let (stdout, stderr) = psql.execute()?;
    Ok(())
}

Feature flags

The following features are available:

Name Description Default?
tokio Enables the use of tokio commands No

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~4.5–8MB
~70K SLoC