28 releases (9 breaking)

0.17.3 Nov 12, 2024
0.17.0 Sep 28, 2024
0.14.2 Jul 17, 2024

#1064 in Database interfaces

Download history 772/week @ 2024-08-21 900/week @ 2024-08-28 835/week @ 2024-09-04 647/week @ 2024-09-11 618/week @ 2024-09-18 1128/week @ 2024-09-25 986/week @ 2024-10-02 642/week @ 2024-10-09 664/week @ 2024-10-16 718/week @ 2024-10-23 839/week @ 2024-10-30 829/week @ 2024-11-06 923/week @ 2024-11-13 768/week @ 2024-11-20 531/week @ 2024-11-27 554/week @ 2024-12-04

2,969 downloads per month
Used in 6 crates (2 directly)

(Apache-2.0 OR MIT) AND PostgreSQL

405KB
11K 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

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

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

~0.7–7MB
~46K SLoC