How to connect, and what the client does with rows and names.
url: amysql://URL, overriding the connection fields below andconnect_optionshost(localhost) /port(3306) /database/username/passwordmax_connections: the pool's size (10)connection_ttl: an unused connection closes after this long (60 seconds)connect_options: moreasyncmy.connectkeywords (Effect'spoolConfig)disable_prepared_statements: send statements as text with their parameters escaped in, for proxies withoutCOM_STMT_PREPARE(Cloudflare Hyperdrive)span_attributes: added to every statement's spantransform_result_names/transform_query_names: rename result columns / identifiers (fx.casehas the usual ones)
Attributes#
| Attribute | Type | Description |
|---|---|---|
url | Redacted[str] | None = None | |
host | str | None = None | |
port | int | None = None | |
database | str | None = None | |
username | str | None = None | |
password | Redacted[str] | None = None | |
max_connections | int | None = None | |
connection_ttl | DurationInput | None = None | |
connect_options | Mapping[str, Any] = field(default_factory=(dict[str, Any])) | |
disable_prepared_statements | bool = False | |
span_attributes | Mapping[str, object] = field(default_factory=(dict[str, object])) | |
transform_result_names | Callable[[str], str] | None = None | |
transform_query_names | Callable[[str], str] | None = None |
Functions#
__init__#
__init__(*, url=None, host=None, port=None, database=None, username=None, password=None, max_connections=None, connection_ttl=None, connect_options=dict[str, Any](), disable_prepared_statements=False, span_attributes=dict[str, object](), transform_result_names=None, transform_query_names=None) -> None| Parameter | Type | Description |
|---|---|---|
url | Redacted[str] | None = None | |
host | str | None = None | |
port | int | None = None | |
database | str | None = None | |
username | str | None = None | |
password | Redacted[str] | None = None | |
max_connections | int | None = None | |
connection_ttl | DurationInput | None = None | |
connect_options | Mapping[str, Any] = dict[str, Any]() | |
disable_prepared_statements | bool = False | |
span_attributes | Mapping[str, object] = dict[str, object]() | |
transform_result_names | Callable[[str], str] | None = None | |
transform_query_names | Callable[[str], str] | None = None |