2020-08-19 03:46:02 -05:00
|
|
|
|
##########################################################################
|
|
|
|
|
#
|
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
|
#
|
2024-01-01 02:43:48 -06:00
|
|
|
|
# Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
2020-08-19 03:46:02 -05:00
|
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
|
#
|
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
|
|
"""Application wide constants."""
|
2021-11-24 05:52:57 -06:00
|
|
|
|
from flask_babel import gettext
|
2020-08-20 07:28:37 -05:00
|
|
|
|
|
|
|
|
|
# Mimetypes
|
|
|
|
|
MIMETYPE_APP_HTML = 'text/html'
|
|
|
|
|
MIMETYPE_APP_JS = 'application/javascript'
|
2022-04-26 06:11:10 -05:00
|
|
|
|
MIMETYPE_APP_JSON = 'application/json'
|
2020-08-20 07:28:37 -05:00
|
|
|
|
|
|
|
|
|
# Preference labels
|
|
|
|
|
PREF_LABEL_KEYBOARD_SHORTCUTS = gettext('Keyboard shortcuts')
|
|
|
|
|
PREF_LABEL_DISPLAY = gettext('Display')
|
2023-04-26 00:48:16 -05:00
|
|
|
|
PREF_LABEL_BREADCRUMBS = gettext('Object Breadcrumbs')
|
2020-08-20 07:28:37 -05:00
|
|
|
|
PREF_LABEL_OPTIONS = gettext('Options')
|
|
|
|
|
PREF_LABEL_EXPLAIN = gettext('Explain')
|
|
|
|
|
PREF_LABEL_EDITOR = gettext('Editor')
|
|
|
|
|
PREF_LABEL_CSV_TXT = gettext('CSV/TXT Output')
|
|
|
|
|
PREF_LABEL_RESULTS_GRID = gettext('Results grid')
|
|
|
|
|
PREF_LABEL_SQL_FORMATTING = gettext('SQL formatting')
|
2020-11-04 06:15:28 -06:00
|
|
|
|
PREF_LABEL_TABS_SETTINGS = gettext('Tab settings')
|
2022-06-22 06:48:51 -05:00
|
|
|
|
PREF_LABEL_REFRESH_RATES = gettext('Refresh rates')
|
2022-06-23 04:22:11 -05:00
|
|
|
|
PREF_LABEL_GRAPH_VISUALISER = gettext('Graph Visualiser')
|
2020-08-19 03:46:02 -05:00
|
|
|
|
|
2022-03-04 05:51:30 -06:00
|
|
|
|
PGADMIN_STRING_SEPARATOR = '_$PGADMIN$_'
|
2020-08-19 03:46:02 -05:00
|
|
|
|
PGADMIN_NODE = 'pgadmin.node.%s'
|
|
|
|
|
UNAUTH_REQ = "Unauthorized request."
|
2020-08-28 07:47:27 -05:00
|
|
|
|
SERVER_CONNECTION_CLOSED = gettext(
|
|
|
|
|
'Not connected to server or connection with the server has been closed.')
|
2020-09-03 08:05:58 -05:00
|
|
|
|
|
2021-06-07 11:37:51 -05:00
|
|
|
|
# Query tool placeholder
|
|
|
|
|
QT_DEFAULT_PLACEHOLDER = '%DATABASE%/%USERNAME%@%SERVER%'
|
2022-04-07 07:06:56 -05:00
|
|
|
|
VW_EDT_DEFAULT_PLACEHOLDER = '%SCHEMA%.%TABLE%/%DATABASE%/%USERNAME%@%SERVER%'
|
2021-06-07 11:37:51 -05:00
|
|
|
|
|
2020-09-03 08:05:58 -05:00
|
|
|
|
# Data Types
|
|
|
|
|
DATATYPE_TIME_WITH_TIMEZONE = 'time with time zone'
|
|
|
|
|
DATATYPE_TIME_WITHOUT_TIMEZONE = 'time without time zone'
|
|
|
|
|
|
|
|
|
|
DATATYPE_TIMESTAMP_WITH_TIMEZONE = 'timestamp with time zone'
|
|
|
|
|
DATATYPE_TIMESTAMP_WITHOUT_TIMEZONE = 'timestamp without time zone'
|
|
|
|
|
|
|
|
|
|
# Error Messages
|
|
|
|
|
ERROR_MSG_TRANS_ID_NOT_FOUND = gettext(
|
|
|
|
|
'Transaction ID not found in the session.')
|
2020-09-07 07:26:02 -05:00
|
|
|
|
|
2023-12-27 02:06:20 -06:00
|
|
|
|
ERROR_MSG_FAIL_TO_PROMOTE_QT = gettext('FAIL TO PROMOTE VIEW/EDIT DATA '
|
|
|
|
|
'TO QUERY TOOL')
|
|
|
|
|
|
2020-09-07 07:26:02 -05:00
|
|
|
|
# Role module constant
|
|
|
|
|
ERROR_FETCHING_ROLE_INFORMATION = gettext(
|
|
|
|
|
'Error fetching role information from the database server.')
|
2020-10-01 02:59:00 -05:00
|
|
|
|
|
|
|
|
|
ERROR_FETCHING_DATA = gettext('Unable to fetch data.')
|
2021-01-18 05:02:10 -06:00
|
|
|
|
|
2024-05-20 06:24:49 -05:00
|
|
|
|
ERROR_SERVER_ID_NOT_SPECIFIED = gettext('Server ID not specified.')
|
|
|
|
|
|
2021-01-18 05:02:10 -06:00
|
|
|
|
# Authentication Sources
|
|
|
|
|
INTERNAL = 'internal'
|
|
|
|
|
LDAP = 'ldap'
|
|
|
|
|
KERBEROS = 'kerberos'
|
2021-10-12 04:22:30 -05:00
|
|
|
|
OAUTH2 = 'oauth2'
|
|
|
|
|
WEBSERVER = 'webserver'
|
2021-01-18 05:02:10 -06:00
|
|
|
|
|
|
|
|
|
SUPPORTED_AUTH_SOURCES = [INTERNAL,
|
|
|
|
|
LDAP,
|
2021-07-06 02:52:58 -05:00
|
|
|
|
KERBEROS,
|
2021-10-12 04:22:30 -05:00
|
|
|
|
OAUTH2,
|
|
|
|
|
WEBSERVER]
|
2021-06-07 10:06:34 -05:00
|
|
|
|
|
|
|
|
|
BINARY_PATHS = {
|
|
|
|
|
"as_bin_paths": [
|
|
|
|
|
{"version": "120000", "next_major_version": "130000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 12"), "binaryPath": None,
|
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "130000", "next_major_version": "140000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 13"), "binaryPath": None,
|
2021-09-20 04:29:05 -05:00
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "140000", "next_major_version": "150000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 14"), "binaryPath": None,
|
2022-05-25 07:13:48 -05:00
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "150000", "next_major_version": "160000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 15"), "binaryPath": None,
|
2023-11-20 06:01:39 -06:00
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "160000", "next_major_version": "170000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 16"), "binaryPath": None,
|
2024-06-27 02:48:26 -05:00
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "170000", "next_major_version": "180000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 17"), "binaryPath": None,
|
2021-06-07 10:06:34 -05:00
|
|
|
|
"isDefault": False}
|
|
|
|
|
],
|
|
|
|
|
"pg_bin_paths": [
|
|
|
|
|
{"version": "120000", "next_major_version": "130000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 12"), "binaryPath": None,
|
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "130000", "next_major_version": "140000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 13"), "binaryPath": None,
|
2021-09-20 04:29:05 -05:00
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "140000", "next_major_version": "150000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 14"), "binaryPath": None,
|
2022-05-25 07:13:48 -05:00
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "150000", "next_major_version": "160000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 15"), "binaryPath": None,
|
2023-07-27 07:04:25 -05:00
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "160000", "next_major_version": "170000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 16"), "binaryPath": None,
|
2024-06-27 02:48:26 -05:00
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "170000", "next_major_version": "180000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 17"), "binaryPath": None,
|
2021-06-07 10:06:34 -05:00
|
|
|
|
"isDefault": False}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UTILITIES_ARRAY = ['pg_dump', 'pg_dumpall', 'pg_restore', 'psql']
|
2021-07-05 02:25:40 -05:00
|
|
|
|
|
|
|
|
|
ENTER_EMAIL_ADDRESS = "Email address: "
|
2022-01-04 00:57:17 -06:00
|
|
|
|
USER_NOT_FOUND = gettext("The specified user ID (%s) could not be found.")
|
2022-05-17 10:02:17 -05:00
|
|
|
|
DATABASE_LAST_SYSTEM_OID = 16383
|
2023-02-15 00:01:29 -06:00
|
|
|
|
|
|
|
|
|
# Drivers
|
|
|
|
|
PSYCOPG3 = 'psycopg3'
|
2023-03-06 05:33:47 -06:00
|
|
|
|
|
|
|
|
|
# Shared storage
|
|
|
|
|
MY_STORAGE = 'my_storage'
|
2023-03-24 00:38:27 -05:00
|
|
|
|
ACCESS_DENIED_MESSAGE = gettext(
|
|
|
|
|
"Access denied: You’re having limited access. You’re not allowed to "
|
|
|
|
|
"Rename, Delete or Create any files/folders")
|
2023-05-22 00:38:29 -05:00
|
|
|
|
|
|
|
|
|
|
2023-05-24 07:36:21 -05:00
|
|
|
|
KEY_RING_SERVICE_NAME = 'pgAdmin4'
|
2024-08-22 06:14:57 -05:00
|
|
|
|
KEY_RING_USER_NAME = 'pgadmin4-master-password'
|
2023-05-24 07:36:21 -05:00
|
|
|
|
KEY_RING_USERNAME_FORMAT = KEY_RING_SERVICE_NAME + '-{0}-{1}'
|
|
|
|
|
KEY_RING_TUNNEL_FORMAT = KEY_RING_SERVICE_NAME + '-tunnel-{0}-{1}'
|
|
|
|
|
KEY_RING_DESKTOP_USER = KEY_RING_SERVICE_NAME + '-desktop-user-{0}'
|
2023-06-30 05:38:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MessageType:
|
|
|
|
|
SUCCESS = 'Success',
|
|
|
|
|
ERROR = 'Error',
|
|
|
|
|
INFO = 'Info',
|
|
|
|
|
CLOSE = 'Close',
|
|
|
|
|
WARNING = 'Warning'
|
2024-03-18 01:23:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DBMS_JOB_SCHEDULER_ID = 999999
|
2024-06-10 07:34:32 -05:00
|
|
|
|
|
|
|
|
|
# String Constants
|
|
|
|
|
IP_ADDRESS_STRING = '{}/{}'
|
|
|
|
|
TWO_PARAM_STRING = '{0}/{1}'
|
|
|
|
|
SERVER_NOT_FOUND = gettext("Could not find the specified server.")
|