CECTC / dbpack

A db proxy for distributed transaction, read write splitting and sharding! Support any language! It can be deployed as a sidecar in a pod.
https://cectc.github.io/dbpack-doc/#/en-us/
Apache License 2.0
357 stars 46 forks source link

feature: support show table status #263

Closed dk-lockdown closed 2 years ago

dk-lockdown commented 2 years ago

ref: https://github.com/cectc/dbpack/issues/189

Describe what this PR did

Support

show table status like '${tablename}'

If table is a sharded table, select a shard to execute.

Describe how to verify it

check integration test result

codecov-commenter commented 2 years ago

Codecov Report

Merging #263 (2577a31) into dev (6611c17) will decrease coverage by 0.19%. The diff coverage is 3.63%.

@@            Coverage Diff             @@
##              dev     #263      +/-   ##
==========================================
- Coverage   43.23%   43.03%   -0.20%     
==========================================
  Files          82       84       +2     
  Lines       10009    10059      +50     
==========================================
+ Hits         4327     4329       +2     
- Misses       5227     5276      +49     
+ Partials      455      454       -1     
Impacted Files Coverage Δ
pkg/optimize/optimize_show_table_status.go 0.00% <0.00%> (ø)
pkg/optimize/optimizer.go 33.33% <0.00%> (-6.67%) :arrow_down:
pkg/plan/query.go 34.02% <0.00%> (ø)
pkg/plan/show_table_status.go 0.00% <0.00%> (ø)
pkg/executor/sharding.go 37.20% <22.22%> (-0.89%) :arrow_down:
third_party/pools/numbered.go 88.77% <0.00%> (+2.04%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more