connection_string_generator

Crates.ioconnection_string_generator
lib.rsconnection_string_generator
version0.2.0
sourcesrc
created_at2024-08-19 18:45:38.594524
updated_at2024-08-20 14:19:03.011297
descriptionA VERY simple crate to generate database connection strings programmatically.
homepage
repositoryhttps://github.com/twihno/connection-string-generator
max_upload_size
id1344333
size34,087
Thomas Schuster (twihno)

documentation

README

Connection string generator

A VERY simple crate to generate database connection strings programmatically.

Currently supported databases

  • PostgreSQL
  • Microsoft SQL Server

Examples

PostgreSQL

let conn_string = PostgresConnectionString::new()
    .set_username_and_password("user", "password")
    .set_host_with_port("localhost", 5432)
    .set_database_name("db_name")
    .set_connect_timeout(30);

println!("{conn_string}");

Microsoft SQL Server

let conn_string = SqlServerConnectionString::new()
    .set_username_and_password("user", "password")
    .set_host_with_default_port("sql.test.com")
    .set_database_name("db_name")
    .set_connect_timeout(30)
    .enable_encryption_and_trust_server_certificate();

println!("{conn_string}");
Commit count: 0

cargo fmt