Files
hausverwaltung/tools/ws/dbpool.py

20 lines
354 B
Python

import mariadb
pool = None
def createConnectionPool():
global pool
pool = mariadb.ConnectionPool(
user = 'heroes',
password = 'test123',
host = '172.16.10.18',
database = 'heroes',
pool_name = 'wep-app',
pool_size = 5
)
def getConnection():
global pool
return pool.get_connection()