database in service

This commit is contained in:
2021-01-15 12:53:46 +01:00
parent ceadf3338f
commit 24482da680
4 changed files with 97 additions and 21 deletions

19
tools/ws/dbpool.py Normal file
View File

@ -0,0 +1,19 @@
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()