Slight bug fix for the general purpose SQL SELECT function. Also adding more maps.
This commit is contained in:
@@ -954,10 +954,10 @@ def run_sql_select(
|
||||
# https://docs.sqlalchemy.org/en/13/core/sqlelement.html#sqlalchemy.sql.expression.TextClause.columns
|
||||
# https://docs.sqlalchemy.org/en/13/core/type_basics.html
|
||||
# Use the columns method to specify the data types for the columns. This may need to be done for other column names.
|
||||
sql = sql.columns(recurring_start_time=Time, recurring_end_time=Time)
|
||||
if commit:
|
||||
trans = db.begin()
|
||||
|
||||
sql = sql.columns(recurring_start_time=Time, recurring_end_time=Time)
|
||||
if data:
|
||||
log.info('Executing with SQL statement and data...')
|
||||
result = db.execute(sql, data)
|
||||
@@ -990,12 +990,18 @@ def run_sql_select(
|
||||
# db.engine.dispose()
|
||||
log.info('Now trying the query again...')
|
||||
try:
|
||||
if commit:
|
||||
trans = db.begin()
|
||||
|
||||
if data:
|
||||
log.info('2x Executing with SQL statement and data...')
|
||||
result = db.execute(sql, data)
|
||||
else:
|
||||
log.info('2x Executing with SQL statement only...')
|
||||
result = db.execute(sql)
|
||||
|
||||
if commit:
|
||||
trans.commit()
|
||||
except Exception as e:
|
||||
log.error('Tried again an exception was raised again. Not going to try again.')
|
||||
log.exception('**** *** ** * ### BEGIN ### (2x) Second Exception Happened: Returning False * ** *** ****')
|
||||
|
||||
Reference in New Issue
Block a user