# mayim.sql.mysql.interface
# Table of Contents
# MysqlPool
class MysqlPool(BaseInterface)
[view_source] (opens new window)
Interface for connecting to a MySQL database
Parents: BaseInterface
# close
async def close()
[view_source] (opens new window)
Close connections to the pool
# connection
@asynccontextmanager
async def connection(
timeout: Optional[float] = None) -> AsyncIterator[Connection]
[view_source] (opens new window)
Obtain a connection to the database
Arguments:
timeout
float, optional - Not implemented. Defaults toNone
.
Returns:
AsyncIterator[Connection]
- Iterator that will yield a connection
Yields:
Iterator[AsyncIterator[Connection]]
- A database connection
# open
async def open()
[view_source] (opens new window)
Open connections to the pool
# scheme
Default: "mysql"