GitHub

API reference for mysql.

MySQL on asyncmy (Effect's @effect/sql-mysql2; the pyfect-dev[mysql] extra, never imported by pyfect).

asyncmy runs on the SQL loop thread, so the client works under run_blocking and run_async and no fiber blocks::

from pyfect.sql import mysql

layer = mysql.layer(mysql.MysqlClientConfig(url=redacted.make("mysql://...")))
  • client: MysqlClient (an SqlClient with its config), make, layer, layer_config, layer_from, make_compiler
  • config: MysqlClientConfig
  • error: errno classification
  • migrator: migrations

Statements run as server-side prepared statements (binary protocol) unless disable_prepared_statements; unprepared ones and streams are sent as text, several statements at once allowed. Values are asyncmy's: DECIMAL reads as Decimal, BIGINT as int, DATETIME as a naive datetime, JSON parsed, BLOB as bytes; a dict or list parameter goes as its JSON text. A statement without rows gives a ResultSetHeader through .raw.

Re-exports

Classes

Modules