connection_string_generator 0.2.0

A VERY simple crate to generate database connection strings programmatically.
Documentation
  • Coverage
  • 100%
    28 out of 28 items documented21 out of 25 items with examples
  • Size
  • Source code size: 33.76 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.67 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • twihno/connection-string-generator
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • twihno

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}");