first commit

This commit is contained in:
rnsrk 2024-02-07 15:33:41 +01:00
commit 52145ecabf
10 changed files with 538 additions and 0 deletions

9
utils.py Normal file
View file

@ -0,0 +1,9 @@
from sqlalchemy import MetaData, Table
def cleanEntityName(entityName):
return entityName.lower().replace('-', '_').replace('.', '_').replace(' ', '_').replace('(', '_').replace(')', '_').replace('ä', 'ae').replace('ö', 'oe').replace('ü', 'ue').replace('ß', 'ss').replace('?', '_')
def tableExists(engine, table_name):
metadata = MetaData()
metadata.reflect(bind=engine)
return table_name in metadata.tables