get_connection()

Returns a connection from the connection pool or raises a PoolError if a connection is not available.

See also: MariaDB Connector/Python 1.0

EXAMPLES

import mariadb

pool = mariadb.ConnectionPool(
    pool_name = 'pool1',
    pool_size = 3,
    pool_reset_connection = False,
    host = '127.0.0.1',
    user = 'root',
    password = 'secret',
    database = 'test',
    )

conn = pool.get_connection()
cursor = conn.cursor()