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()