Skip to main content

Module connectstring

Module connectstring 

Source
Expand description

Real, full-fidelity Oracle connect-string parsing.

This module parses the three connect-string forms understood by python-oracledb thin mode, matching the reference parser (impl/base/parsers.pyx / connect_params.pyx) semantics:

  1. TNS connect descriptors(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=..)(PORT=..))) (CONNECT_DATA=(SERVICE_NAME=..))), including DESCRIPTION_LIST, multiple ADDRESS_LIST/ADDRESS, LOAD_BALANCE/FAILOVER/ SOURCE_ROUTE, RETRY_COUNT/RETRY_DELAY, EXPIRE_TIME, TRANSPORT_CONNECT_TIMEOUT, SDU, SECURITY (wallet / cert DN), and arbitrary pass-through keys. Case-insensitive keywords, nested parens, quoted values, and whitespace tolerance.

  2. EZConnect / EZConnect-Plus[proto://]host[,host2][:port][/service][:server][/instance][?k=v&..], including multiple hosts, multiple address lists (;), IPv6 [::1], and the extended ?key=value parameters.

  3. tnsnames.ora — alias -> descriptor maps with comments (#), multi-line entries, comma-separated alias lists, and IFILE includes (with cycle detection), resolved relative to TNS_ADMIN / a config dir.

Beyond parity, the parser produces rich diagnostics: every error points at the offending byte offset with surrounding context, and Descriptor offers a Descriptor::describe troubleshooting dump of the resolved address list and connect data.

Modules§

tnsnames
Parses tnsnames.ora files into an alias -> connect-descriptor map.

Structs§

Address
A single resolved network endpoint (one ADDRESS node).
AddressList
A group of Addresses (one ADDRESS_LIST node) plus its navigation flags.
ConnectData
Resolved CONNECT_DATA settings.
Description
A single resolved DESCRIPTION node.
Descriptor
A fully parsed connect string: one or more Descriptions.
Security
Resolved SECURITY settings (only meaningful for TCPS addresses).

Enums§

Protocol
Transport protocol parsed from an ADDRESS PROTOCOL= or an EZConnect proto:// prefix.
Purity
DRCP connection-pool purity ((POOL_PURITY=..)).
ServerType
Database server connection mode ((SERVER=..) / :server in EZConnect).

Constants§

DEFAULT_PORT
Default listener port when none is given (reference DEFAULT_PORT).
DEFAULT_RETRY_DELAY
Default retry delay (reference DEFAULT_RETRY_DELAY).
DEFAULT_SDU
Default SDU in bytes (reference DEFAULT_SDU).
DEFAULT_TCPS_PORT
Default TCPS listener port.
DEFAULT_TCP_CONNECT_TIMEOUT
Default transport connect timeout in seconds.
MAX_SDU
Maximum SDU after sanitisation.
MIN_SDU
Minimum SDU after sanitisation.

Functions§

parse
Parses a connect string into a Descriptor.