Expand description
Connection-string parser shared across reddb, reddb-client,
red_client, and every language driver.
Pure function over a string; no I/O, no allocation beyond what the
returned ConnectionTarget needs. The grammar is defined by
docs/clients/connection-strings.md; this module is the canonical
parser and is the single source of truth consumed by the rest of
the workspace.
The parser ports the logic that previously lived in
drivers/rust/src/connect.rs (which keeps a thin re-export layer
for backwards compatibility while drivers migrate over). Cluster
URIs (grpc://primary,replica:port), default ports per scheme,
and the ?route=primary override behave identically to the
original.
Structs§
- Conn
String Limits - DoS guardrails applied by
parsebefore any URI work happens. - Connection
Spec - Connection target plus URL-derived auth metadata.
- Parse
Error - Error returned by
parse.
Enums§
- Connection
Auth - Authentication material derived from a connection string or adjacent CLI
fallback.
Debugdeliberately redacts every caller-supplied credential. - Connection
Scheme - URI schemes accepted by the connection-string parser.
- Connection
Target - Normalised target produced by
parse. - Parse
Error Kind - Stable error code for parser failures.
Constants§
- DEFAULT_
PORT_ GRPC - DEFAULT_
PORT_ GRPCS - DEFAULT_
PORT_ RED - Default port per documented scheme. Centralised so other crates (the connector, server-side dispatch) can stay consistent.
- DEFAULT_
PORT_ WS - Default ports for
ws:///red+ws://andwss:///red+wss://— align with the standard WS / WSS browser defaults (80 and 443) so a hosted endpoint like*.db.reddb.ioworks without an explicit port. - DEFAULT_
PORT_ WSS - SUPPORTED_
SCHEMES - Stable parser-owned list of supported URI schemes.
Functions§
- is_
embedded_ connection_ uri - Return true for documented embedded aliases that must not resolve to a remote transport target.
- parse
- Parse a connection URI into a
ConnectionTargetunder the default DoS limits. - parse_
with_ auth - Parse a connection URI and derive auth from RFC 3986 userinfo.
- parse_
with_ limits - Same as
parsebut with caller-supplied DoS guardrails. Useful for tests that need tighter limits or for callers (a future admin tool, an offline validator) that need to relax the defaults.