add_connection()

Overview

In 1.1:

Adds a connection object to the connection pool. In case that the pool doesn't have a free slot or is not configured a PoolError exception will be raised.

In 1.0:

Adds a connection to the connection pool. In case the pool doesn't have a free slot or is not configured a PoolError exception will be raised.

See also: MariaDB Connector/Python 1.1 and in 1.0

EXAMPLES

Create a pool object and add a connection to it:

import mariadb

pool = mariadb.ConnectionPool(pool_size=3)

conn = mariadb.connect(
    host = 'localhost',
    user = 'root',
    password = 'secret',
    )

pool.add_connection(conn)

CHANGE HISTORY

Release Series

History

1.1

  • Present starting in MariaDB Connector/Python 1.1.0rc1.

1.0

  • Present starting in MariaDB Connector/Python 1.0.0.