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

show table rules #760

Merged
merged 1 commit into from
Sep 30, 2023
Merged

show table rules #760

merged 1 commit into from
Sep 30, 2023

Conversation

binbin0325
Copy link
Contributor

What this PR does:
support show table rules from

Which issue(s) this PR fixes:

Fixes #628

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2023

Codecov Report

Attention: 67 lines in your changes are missing coverage. Please review.

Comparison is base (304e9ff) 38.38% compared to head (b365ceb) 40.33%.
Report is 10 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #760      +/-   ##
==========================================
+ Coverage   38.38%   40.33%   +1.94%     
==========================================
  Files         254      265      +11     
  Lines       26359    26897     +538     
==========================================
+ Hits        10119    10849     +730     
+ Misses      15121    14881     -240     
- Partials     1119     1167      +48     
Files Coverage Δ
pkg/runtime/ast/proto.go 63.15% <ø> (+17.00%) ⬆️
pkg/executor/redirect.go 3.30% <0.00%> (-0.22%) ⬇️
pkg/runtime/ast/ast.go 71.37% <0.00%> (+3.04%) ⬆️
pkg/runtime/ast/show.go 28.90% <0.00%> (-0.70%) ⬇️
pkg/runtime/plan/dal/show_database_rules.go 0.00% <0.00%> (ø)
pkg/runtime/plan/dal/show_table_rules.go 0.00% <0.00%> (ø)

... and 23 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

proto.NewValueString(strings.Join(columns, ",")),
proto.NewValueString(""),
proto.NewValueString(fmt.Sprintf("%s", vs.Table.Computer)),
proto.NewValueInt64(int64(step)),
Copy link
Contributor

@jjeffcaii jjeffcaii Sep 4, 2023

Choose a reason for hiding this comment

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

How about changing step to varchar? I mean, for the columns [{"column":"foo"},{"column":"bar","step":2}], we can return:

... columns ... steps
... foo,bar ... 1,2

@dongzl dongzl added this to the 0.2.0 milestone Sep 15, 2023
@dongzl dongzl added the SQL SQL support label Sep 15, 2023
@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
4.8% 4.8% Duplication


for _, v := range tests {
rows, err := db.Query(v.sql)
defer rows.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

Use closure instead, never defer in a for-loop directly.

@AlexStocks AlexStocks merged commit ac511fe into arana-db:master Sep 30, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SQL SQL support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SQL] Support show table rules from xxx
6 participants