connparse
Connparse parses database connection strings, DSNs, URLs, file paths, and cloud storage URIs into one predictable Rust value.
Connparse is useful when your app accepts connection strings from different systems and you want to pull out the host, port, database, bucket, path, credentials, query options, and a safe redacted string.
Supported sources include PostgreSQL, MySQL, MariaDB, SQLite, DuckDB, ClickHouse, Redis, Memcached, Elasticsearch, MongoDB, CockroachDB, QuestDB, YugabyteDB, TiDB, Valkey, Dragonfly, OpenSearch, FerretDB, ElastiCache, DocumentDB, SQL Server, Oracle, Snowflake, Cassandra, BigQuery, Redshift, Aurora, Neo4j, Trino, Databricks, DynamoDB, StarRocks, SAP HANA, Athena, Spanner, Google Cloud Storage, Azure Blob, Azure Data Lake Storage, Azure Files, Azure Cosmos DB, Business Central, TallyPrime, Amazon S3, and local file paths.
Install
[]
= "0.3"
Basic Usage
use parse;
parse() returns the same JSON-shaped result contract as the JavaScript, Go,
and Python packages:
Use safe for logs and UI labels. Do not log raw or credentials unless the
user explicitly asks to reveal secrets.
For stable comparison keys, use parse_normalize():
use parse_normalize;
let result = parse_normalize;
assert_eq!;