The aiomysql connector for MySQL/MariaDB databases.
Classes
AiomysqlConnector (dsn) |
A connector that uses the aiomysql library. |
AiomysqlResultSet (cursor) |
Represents a result set returned by the MySQL database. |
AiomysqlTransaction (connector) |
Represents a transaction for aiomysql. |
CONNECTOR_TYPE |
alias of asyncqlio.backends.mysql.aiomysql.AiomysqlConnector |
asyncqlio.backends.mysql.aiomysql.
AiomysqlResultSet
(cursor)[source]¶Bases: asyncqlio.backends.base.BaseResultSet
Represents a result set returned by the MySQL database.
keys
¶Returns: | An iterable of keys that this query contained. |
---|
asyncqlio.backends.mysql.aiomysql.
AiomysqlTransaction
(connector)[source]¶Bases: asyncqlio.backends.base.BaseTransaction
Represents a transaction for aiomysql.
connection
= None¶The current acquired connection for this transaction.
cursor
(self, sql, params=None)[source]¶Returns a AiomysqlResultSet
for the specified SQL.
Return type: | AiomysqlResultSet |
---|
create_savepoint
(name)¶Creates a savepoint in the current transaction.
Warning
This is not supported in all DB engines. If so, this will raise
NotImplementedError
.
Parameters: | name (str ) – The name of the savepoint to create. |
---|
asyncqlio.backends.mysql.aiomysql.
AiomysqlConnector
(dsn)[source]¶Bases: asyncqlio.backends.base.BaseConnector
A connector that uses the aiomysql library.
pool
= None¶The current connection pool for this connector.
get_transaction
()[source]¶Gets a new transaction object.
Return type: | BaseTransaction |
---|
emit_param
(name)[source]¶Emits a parameter that can be used as a substitute during a query.
Parameters: | name (str ) – The name of the parameter. |
---|---|
Return type: | str |
Returns: | A string that represents the substitute to be placed in the query. |
connect
(self, *, loop=None)[source]¶Connects this connector.
Return type: | AiomysqlConnector |
---|
asyncqlio.backends.mysql.aiomysql.
CONNECTOR_TYPE
¶alias of asyncqlio.backends.mysql.aiomysql.AiomysqlConnector