MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / reset_layout_db

Function reset_layout_db

web/regression/python_test_utils/test_utils.py:998–1021  ·  view source on GitHub ↗
(user_id=None)

Source from the content-addressed store, hash-verified

996
997
998def reset_layout_db(user_id=None):
999 retry = 3
1000 while retry > 0:
1001 try:
1002 conn = sqlite3.connect(config.TEST_SQLITE_PATH)
1003 cur = conn.cursor()
1004
1005 if user_id is None:
1006 cur.execute(
1007 'DELETE FROM SETTING WHERE SETTING in '
1008 '("Browser/Layout", "SQLEditor/Layout", "Debugger/Layout")'
1009 )
1010 else:
1011 cur.execute(
1012 'DELETE FROM SETTING WHERE SETTING in '
1013 '("Browser/Layout", "SQLEditor/Layout", "Debugger/Layout")'
1014 ' AND USER_ID=?', user_id
1015 )
1016 cur.execute('DELETE FROM process')
1017 conn.commit()
1018 conn.close()
1019 break
1020 except Exception:
1021 retry -= 1
1022
1023
1024def remove_db_file():

Callers

nothing calls this directly

Calls 3

connectMethod · 0.45
executeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected