Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

清理查询模块代码,便于接入各种类型的数据库 #83

Merged
merged 9 commits into from
Mar 28, 2019

Conversation

hhyo
Copy link
Owner

@hhyo hhyo commented Mar 28, 2019

  • mysql脱敏处理,统一异常信息
  • 查询权限校验优化,统一异常信息
  • 查询结果显示优化,错误信息统一在表格内展示
  • 剔除mysql查询show create table 的权限校验
  • 补充查询权限的测试用例

@hhyo hhyo requested a review from LeoQuote March 28, 2019 04:21
@codecov
Copy link

codecov bot commented Mar 28, 2019

Codecov Report

Merging #83 into master will increase coverage by 2.67%.
The diff coverage is 56.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #83      +/-   ##
==========================================
+ Coverage   64.35%   67.03%   +2.67%     
==========================================
  Files          59       59              
  Lines        5729     5818      +89     
==========================================
+ Hits         3687     3900     +213     
+ Misses       2042     1918     -124
Impacted Files Coverage Δ
sql/urls.py 100% <ø> (ø) ⬆️
sql/engines/tests.py 100% <100%> (ø) ⬆️
sql/engines/models.py 46.23% <100%> (ø) ⬆️
sql/tests.py 100% <100%> (ø) ⬆️
sql/sql_optimize.py 69.86% <12.5%> (-16.11%) ⬇️
sql/engines/inception.py 18.08% <14.28%> (-0.44%) ⬇️
sql/engines/mssql.py 77.27% <20%> (-2.49%) ⬇️
sql/query.py 47.96% <28.26%> (+3.73%) ⬆️
sql/engines/__init__.py 68.18% <33.33%> (-14.32%) ⬇️
sql/utils/data_masking.py 7.05% <4.1%> (-0.12%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a16e91...5630e96. Read the comment docs.

@hhyo hhyo marked this pull request as ready for review March 28, 2019 12:12
@hhyo hhyo merged commit 61d3340 into master Mar 28, 2019
@hhyo hhyo deleted the query_code_optimization branch March 28, 2019 12:18
@@ -44,37 +43,34 @@ def query(request):
return result

# 服务器端参数验证
if sql_content is None or db_name is None or instance_name is None or limit_num is None:
if not (sql_content and db_name and instance_name and limit_num):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里要不改成 if None in [sql_content, db_name, instance_name, limit_num]:

因为理论上来说and再否的话, 稍微有点低效

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以的,我是感觉这些写着清爽点就改了,效率我还真不晓得

@hhyo hhyo added this to Done in v1.5.0 Mar 30, 2019
@hhyo hhyo added the enhancement New feature or request label Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
v1.5.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants