10 releases

0.9.5 Jun 3, 2024
0.9.4 May 31, 2024
0.9.0 Apr 26, 2024
0.8.3 Apr 21, 2024

#1265 in Database interfaces

Download history 238/week @ 2024-03-28 305/week @ 2024-04-04 225/week @ 2024-04-11 284/week @ 2024-04-18 403/week @ 2024-04-25 208/week @ 2024-05-02 50/week @ 2024-05-09 626/week @ 2024-05-16 280/week @ 2024-05-23 625/week @ 2024-05-30 215/week @ 2024-06-06

1,756 downloads per month
Used in 3 crates (via postgresql_embedded)

(Apache-2.0 OR MIT) AND PostgreSQL

365KB
10K 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.8–7.5MB
~50K SLoC