use-db-url 0.1.0

Primitive database URL and DSN metadata for RustUse
Documentation
  • Coverage
  • 92.5%
    37 out of 40 items documented1 out of 28 items with examples
  • Size
  • Source code size: 14.08 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 945.11 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-database
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-db-url

Database URL and DSN metadata primitives with lightweight parsing helpers.

This crate is part of the use-database facade workspace. It provides small, engine-neutral vocabulary types and metadata containers. It does not connect to databases, execute queries, run migrations, parse SQL, or model engine-specific behavior.

Example

use use_db_url::{DatabaseUrl, parse_database_url_basic};

let url = DatabaseUrl::new("postgresql://localhost:5432/app").expect("valid URL");
let parts = parse_database_url_basic(url.as_str()).expect("parseable URL");

assert_eq!(parts.scheme.as_str(), "postgresql");
assert_eq!(parts.port.expect("port").value(), 5432);