GitHub

MysqlClientConfig

API reference for MysqlClientConfig.

How to connect, and what the client does with rows and names.

  • url: a mysql:// URL, overriding the connection fields below and connect_options
  • host (localhost) / port (3306) / database / username / password
  • max_connections: the pool's size (10)
  • connection_ttl: an unused connection closes after this long (60 seconds)
  • connect_options: more asyncmy.connect keywords (Effect's poolConfig)
  • disable_prepared_statements: send statements as text with their parameters escaped in, for proxies without COM_STMT_PREPARE (Cloudflare Hyperdrive)
  • span_attributes: added to every statement's span
  • transform_result_names / transform_query_names: rename result columns / identifiers (fx.case has the usual ones)

Attributes

AttributeTypeDescription
urlRedacted[str] | None = None
hoststr | None = None
portint | None = None
databasestr | None = None
usernamestr | None = None
passwordRedacted[str] | None = None
max_connectionsint | None = None
connection_ttlDurationInput | None = None
connect_optionsMapping[str, Any] = field(default_factory=(dict[str, Any]))
disable_prepared_statementsbool = False
span_attributesMapping[str, object] = field(default_factory=(dict[str, object]))
transform_result_namesCallable[[str], str] | None = None
transform_query_namesCallable[[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
ParameterTypeDescription
urlRedacted[str] | None = None
hoststr | None = None
portint | None = None
databasestr | None = None
usernamestr | None = None
passwordRedacted[str] | None = None
max_connectionsint | None = None
connection_ttlDurationInput | None = None
connect_optionsMapping[str, Any] = dict[str, Any]()
disable_prepared_statementsbool = False
span_attributesMapping[str, object] = dict[str, object]()
transform_result_namesCallable[[str], str] | None = None
transform_query_namesCallable[[str], str] | None = None