Registry / database / postgres-native-tls

postgres-native-tls

JSON →
library0.5.3rscratesunverified

TLS support for tokio-postgres via native-tls, enabling encrypted database connections.

# Cargo.toml [dependencies] postgres-native-tls = "0.5.3"
INSTALL
IMPORT
SIG · POSTGRES-NATIVE-TL
P
postgres-native-tls
databaserustv0.5.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MakeTlsConnector
use postgres_native_tls::MakeTlsConnector;

Creates a TLS connector for tokio-postgres using native-tls.

use postgres_native_tls::MakeTlsConnector; use tokio_postgres::NoTls; #[tokio::main] async fn main() { let connector = MakeTlsConnector::new(native_tls::TlsConnector::new().unwrap()); let (client, connection) = tokio_postgres::connect("host=localhost user=postgres", connector).await.unwrap(); // Use client... }
Debug
Known issues
gotchaRequires the `tokio-postgres` crate and a Tokio runtime.
fix
Add tokio-postgres to dependencies and use #[tokio::main] or similar runtime.
affects: >=0.5.0
Upgrade
Version history
0.5.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
70 hits · last 30 days
node
66
Amazon
1
Resources
postgres-native-tls — cargo add postgres-native-tls · libregistry