2018-02-09 05:54:42 -06:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2023-01-02 00:23:55 -06:00
|
|
|
# Copyright (C) 2013 - 2023, The pgAdmin Development Team
|
2018-02-09 05:54:42 -06:00
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
"""Definition of constants for SQLEditor."""
|
2021-11-24 05:52:57 -06:00
|
|
|
from flask_babel import gettext
|
2018-02-09 05:54:42 -06:00
|
|
|
|
|
|
|
# Async Constants
|
|
|
|
ASYNC_OK = 1
|
|
|
|
ASYNC_READ_TIMEOUT = 2
|
|
|
|
ASYNC_WRITE_TIMEOUT = 3
|
|
|
|
ASYNC_NOT_CONNECTED = 4
|
|
|
|
ASYNC_EXECUTION_ABORTED = 5
|
|
|
|
|
|
|
|
# Transaction status constants
|
|
|
|
TX_STATUS_IDLE = 0
|
|
|
|
TX_STATUS__ACTIVE = 1
|
|
|
|
TX_STATUS_INTRANS = 2
|
|
|
|
TX_STATUS_INERROR = 3
|
|
|
|
|
|
|
|
# Connection status codes mapping
|
|
|
|
CONNECTION_STATUS_MESSAGE_MAPPING = dict({
|
2020-10-27 00:21:35 -05:00
|
|
|
0: gettext('The session is idle and there is no current transaction.'),
|
|
|
|
1: gettext('A command is currently in progress.'),
|
|
|
|
2: gettext('The session is idle in a valid transaction block.'),
|
|
|
|
3: gettext('The session is idle in a failed transaction block.'),
|
|
|
|
4: gettext('The connection with the server is bad.')
|
2018-02-09 05:54:42 -06:00
|
|
|
})
|