Skip to content

Commit 9ef5fad

Browse files
introduce metadata commands
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 7f5c715 commit 9ef5fad

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/databricks/sql/backend/sea/utils/constants.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,23 @@ class WaitTimeout(Enum):
4545

4646
ASYNC = "0s"
4747
SYNC = "10s"
48+
49+
50+
class MetadataCommands(Enum):
51+
"""SQL commands used in the SEA backend.
52+
53+
These constants are used for metadata operations and other SQL queries
54+
to ensure consistency and avoid string literal duplication.
55+
"""
56+
57+
SHOW_CATALOGS = "SHOW CATALOGS"
58+
SHOW_SCHEMAS = "SHOW SCHEMAS IN {}"
59+
SHOW_TABLES = "SHOW TABLES IN {}"
60+
SHOW_TABLES_ALL_CATALOGS = "SHOW TABLES IN ALL CATALOGS"
61+
SHOW_COLUMNS = "SHOW COLUMNS IN CATALOG {}"
62+
63+
SCHEMA_LIKE_PATTERN = " SCHEMA LIKE '{}'"
64+
TABLE_LIKE_PATTERN = " TABLE LIKE '{}'"
65+
LIKE_PATTERN = " LIKE '{}'"
66+
67+
CATALOG_SPECIFIC = "CATALOG {}"

0 commit comments

Comments
 (0)