-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'architectural_overhaul' into tables_list
- Loading branch information
Showing
24 changed files
with
363 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
MATHESAR_PREFIX = "mathesar_" | ||
ID = "id" | ||
ID_ORIGINAL = "id_original" | ||
INFERENCE_SCHEMA = f"{MATHESAR_PREFIX}inference_schema" | ||
COLUMN_NAME_TEMPLATE = 'Column ' # auto generated column name 'Column 1' (no undescore) | ||
MSAR_PUBLIC = 'msar' | ||
MSAR_PRIVAT = f"__{MSAR_PUBLIC}" | ||
MSAR_VIEWS = f"{MSAR_PUBLIC}_views" | ||
|
||
MATHESAR_PREFIX = "mathesar_" | ||
MSAR_PUBLIC_SCHEMA = 'msar' | ||
MSAR_PRIVATE_SCHEMA = f"__{MSAR_PUBLIC_SCHEMA}" | ||
TYPES_SCHEMA = f"{MATHESAR_PREFIX}types" | ||
INFERENCE_SCHEMA = f"{MATHESAR_PREFIX}inference_schema" | ||
VIEWS_SCHEMA = f"{MSAR_PUBLIC_SCHEMA}_views" | ||
|
||
INTERNAL_SCHEMAS = { | ||
TYPES_SCHEMA, | ||
MSAR_PUBLIC_SCHEMA, | ||
MSAR_PRIVATE_SCHEMA, | ||
VIEWS_SCHEMA, | ||
INFERENCE_SCHEMA | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from unittest.mock import patch | ||
from db.columns.operations import drop as col_drop | ||
|
||
|
||
def test_drop_columns(): | ||
with patch.object(col_drop.db_conn, 'exec_msar_func') as mock_exec: | ||
mock_exec.return_value.fetchone = lambda: (3,) | ||
result = col_drop.drop_columns_from_table(123, [1, 3, 5], 'conn') | ||
mock_exec.assert_called_once_with('conn', 'drop_columns', 123, 1, 3, 5) | ||
assert result == 3 | ||
|
||
|
||
def test_drop_columns_single(): | ||
with patch.object(col_drop.db_conn, 'exec_msar_func') as mock_exec: | ||
mock_exec.return_value.fetchone = lambda: (1,) | ||
result = col_drop.drop_columns_from_table(123, [1], 'conn') | ||
mock_exec.assert_called_once_with('conn', 'drop_columns', 123, 1) | ||
assert result == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.