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(anSqlClientwith itsconfig),make,layer,layer_config,layer_from,make_compilerconfig:MysqlClientConfigerror: errno classificationmigrator: 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#
- From
pyfect.sql.mysql.client:layer,layer_config,layer_from,make,make_compiler,MysqlClient,MysqlClientService - From
pyfect.sql.mysql.config:MysqlClientConfig