Skip to content

Commit 42dd398

Browse files
Merge pull request #64 from Synicix/list_schema_query_change
List schema query change
2 parents e66e1c5 + 3be5c25 commit 42dd398

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

dj_gui_api_server/DJConnector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def list_schemas(jwt_payload: dict):
5454
# Attempt to connect return true if successful, false is failed
5555
return [row[0] for row in dj.conn().query("""
5656
SELECT SCHEMA_NAME FROM information_schema.schemata
57-
WHERE SCHEMA_NAME != "information_schema"
57+
WHERE SCHEMA_NAME NOT IN ("information_schema", "sys", "performance_schema", "mysql")
5858
ORDER BY SCHEMA_NAME
5959
""")]
6060

tests/test_schemas.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,4 @@ def test_schemas(token, client, connection):
5151
REST_schemas = client.get('/api/list_schemas',
5252
headers=dict(
5353
Authorization=f'Bearer {token}')).json['schemaNames']
54-
expected_schemas = dj.list_schemas(connection=connection)
55-
assert set(REST_schemas) == set(expected_schemas)
54+
assert set(REST_schemas) == {'schema1', 'schema2'}

0 commit comments

Comments
 (0)