A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mariadb.com/docs/connectors/mariadb-connector-python/api/pool below:

The ConnectionPool class | MariaDB Documentation

The ConnectionPool class | MariaDB Documentation
  1. Connector/Python
  2. API Reference
The ConnectionPool class class ConnectionPool(*args, **kwargs)

Class defining a pool of database connections

MariaDB Connector/Python supports simple connection pooling. A connection pool holds a number of open connections and handles thread safety when providing connections to threads.

The size of a connection pool is configurable at creation time, but cannot be changed afterward. The maximum size of a connection pool is limited to 64 connections.

Keyword Arguments:

ConnectionPool.add_connection(connection=None)

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.

Closes connection pool and all connections.

ConnectionPool.get_connection()

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

ConnectionPool.set_config(**kwargs)

Sets the connection configuration for the connection pool. For valid connection arguments, check the mariadb.connect() method.

Note: This method doesn’t create connections in the pool. To fill the pool, one has to use add_connection() ḿethod.

ConnectionPool attributes ConnectionPool.connection_count

Returns the number of connections in connection pool.

Since version 1.1.0

Returns the maximum size for connection pools.

Returns the size of the connection pool.

Returns the name of the connection pool.

This page is covered by the Creative Commons Attribution 3.0 license .


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4