#sql #postgresql

tokio-postgres

A native, asynchronous PostgreSQL client

33 releases

0.7.13 Feb 2, 2025
0.7.12 Sep 16, 2024
0.7.11 Jul 22, 2024
0.7.10 Aug 25, 2023
0.1.0 Dec 26, 2016

#610 in Database interfaces

Download history 205572/week @ 2025-02-02 278122/week @ 2025-02-09 262919/week @ 2025-02-16 325641/week @ 2025-02-23 325502/week @ 2025-03-02 324423/week @ 2025-03-09 310220/week @ 2025-03-16 300723/week @ 2025-03-23 295386/week @ 2025-03-30 317376/week @ 2025-04-06 288818/week @ 2025-04-13 286955/week @ 2025-04-20 267771/week @ 2025-04-27 267877/week @ 2025-05-04 261120/week @ 2025-05-11 256605/week @ 2025-05-18

1,069,297 downloads per month
Used in 619 crates (282 directly)

MIT/Apache

515KB
12K SLoC

Rust-Postgres

PostgreSQL support for Rust.

postgres Latest Version

Documentation

A native, synchronous PostgreSQL client.

tokio-postgres Latest Version

Documentation

A native, asynchronous PostgreSQL client.

postgres-types Latest Version

Documentation

Conversions between Rust and Postgres types.

postgres-native-tls Latest Version

Documentation

TLS support for postgres and tokio-postgres via native-tls.

postgres-openssl Latest Version

Documentation

TLS support for postgres and tokio-postgres via openssl.

Running test suite

The test suite requires postgres to be running in the correct configuration. The easiest way to do this is with docker:

  1. Install docker and docker-compose.
    1. On ubuntu: sudo apt install docker.io docker-compose.
  2. Make sure your user has permissions for docker.
    1. On ubuntu: sudo usermod -aG docker $USER
  3. Change to top-level directory of rust-postgres repo.
  4. Run docker-compose up -d.
  5. Run cargo test.
  6. Run docker-compose stop.

Dependencies

~7–20MB
~266K SLoC