Skip to content

Commit

Permalink
改为命名参数
Browse files Browse the repository at this point in the history
  • Loading branch information
feiazifeiazi committed Sep 19, 2024
1 parent a03674e commit 5e69682
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions sql/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,14 @@ def instance_resource(request):
if resource_type == "database":
resource = query_engine.get_all_databases()
resource.rows = filter_db_list(
resource.rows, query_engine.instance.show_db_name_regex, True
db_list=resource.rows,
db_name_regex=query_engine.instance.show_db_name_regex,
is_match_regex=True,
)
resource.rows = filter_db_list(
resource.rows, query_engine.instance.denied_db_name_regex, False
db_list=resource.rows,
db_name_regex=query_engine.instance.denied_db_name_regex,
is_match_regex=False,
)
elif resource_type == "schema" and db_name:
resource = query_engine.get_all_schemas(db_name=db_name)
Expand Down
8 changes: 6 additions & 2 deletions sql_api/api_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,14 @@ def post(self, request):
if resource_type == "database":
resource = query_engine.get_all_databases()
resource.rows = filter_db_list(
resource.rows, query_engine.instance.show_db_name_regex, True
db_list=resource.rows,
db_name_regex=query_engine.instance.show_db_name_regex,
is_match_regex=True,
)
resource.rows = filter_db_list(
resource.rows, query_engine.instance.denied_db_name_regex, False
db_list=resource.rows,
db_name_regex=query_engine.instance.denied_db_name_regex,
is_match_regex=False,
)
elif resource_type == "schema" and db_name:
resource = query_engine.get_all_schemas(db_name=db_name)
Expand Down

0 comments on commit 5e69682

Please sign in to comment.