20 lines
392 B
Python
20 lines
392 B
Python
import mariadb
|
|
|
|
pool = None
|
|
|
|
def createConnectionPool(config):
|
|
global pool
|
|
|
|
pool = mariadb.ConnectionPool(
|
|
user = config['user'],
|
|
password = config['password'],
|
|
host = config['host'],
|
|
database = config['database'],
|
|
pool_name = 'heroes-wep-app',
|
|
pool_size = 5
|
|
)
|
|
|
|
def getConnection():
|
|
global pool
|
|
return pool.get_connection()
|