8000 [ISSUE #94] Feat sequence by chuntaojun · Pull Request #211 · arana-db/arana · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ISSUE #94] Feat sequence #211

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

Merged
merged 26 commits into from
Jun 17, 2022

Conversation

chuntaojun
Copy link
Contributor
@chuntaojun chuntaojun commented Jun 6, 2022

What this PR does:

Which issue(s) this PR fixes:

Fixes #94

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

- 支持已snowflake为底座的自增ID插件

@dongzl dongzl added sharding Sharding SQL SQL support labels Jun 7, 2022
@codecov-commenter
Copy link
codecov-commenter commented Jun 10, 2022

Codecov Report

Merging #211 (f115557) into master (a755fb1) will decrease coverage by 0.20%.
The diff coverage is 30.06%.

@@            Coverage Diff             @@
##           master     #211      +/-   ##
==========================================
- Coverage   36.92%   36.72%   -0.21%     
==========================================
  Files          83       86       +3     
  Lines       12999    13178     +179     
==========================================
+ Hits         4800     4839      +39     
- Misses       7596     7730     +134     
- Partials      603      609       +6     
Impacted Files Coverage Δ
pkg/config/model.go 34.83% <ø> (ø)
pkg/mysql/rows/virtual_row.go 33.33% <ø> (ø)
pkg/proto/rule/rule.go 73.86% <0.00%> (-7.39%) ⬇️
pkg/runtime/rule/shard_expr_parse.go 85.54% <ø> (ø)
pkg/runtime/optimize/optimizer.go 27.18% <6.38%> (-2.92%) ⬇️
pkg/sequence/snowflake/snowflake.go 21.42% <21.42%> (ø)
pkg/sequence/sequence.go 69.44% <69.44%> (ø)
pkg/boot/discovery.go 66.44% <100.00%> (+0.11%) ⬆️
pkg/runtime/namespace/namespace.go 73.03% <100.00%> (+0.30%) ⬆️
pkg/runtime/ast/ast.go 78.26% <0.00%> (-0.88%) ⬇️
... and 3 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 a755fb1...f115557. Read the comment docs.

@AlexStocks AlexStocks changed the base branch from master to feature/sequence June 12, 2022 04:21
// Sequence returns the Sequence of table.
Sequence(ctx context.Context, table string) (Sequence, error)
type SequenceManager interface {
// CreateSequence create sequence instance
Copy link
Contributor

Choose a reason for hiding this comment

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

create = creates

@AlexStocks AlexStocks merged commit 324479b into arana-db:feature/sequence Jun 17, 2022
Comment on lines +820 to +824
if err != nil {
if !errors.Is(err, sequence.ErrorNotFoundSequence) {
return err
}
}
Copy link
Member

Choose a reason for hiding this comment

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

if !errors.Is(err, sequence.ErrorNotFoundSequence) {
	return err
}

this will be better

}

if seq != nil {
return nil
Copy link
Member

Choose a reason for hiding this comment

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

here may be need build a error

jjeffcaii pushed a commit that referenced this pull request Jul 17, 2022
* feat: support sequence

* feat: none

* feat: snowflake seqneuce finish

* fix: add sequence unit test

* feat: support sequence

* chore: remove test.log

* fix: fix cr issue

* fix: fix integration_test fail

* style: fix code style

* docs: update code comment

* fix: fix pr issue

* fix: fix sql scriip style

* test: add unit test

* docs: fix sql script comment

* refactor: update auto_increment to sequence

* fix: fix cr issue

* refactor: refactor sequence create mgr

* style: fmt code style

* fix: fix pr issue

* docs: fix code comment

* fix: fix cr issue
dongzl added a commit that referenced this pull request Jul 29, 2022
* [ISSUE #94] Feat sequence (#211)

* feat: support sequence

* feat: none

* feat: snowflake seqneuce finish

* fix: add sequence unit test

* feat: support sequence

* chore: remove test.log

* fix: fix cr issue

* fix: fix integration_test fail

* style: fix code style

* docs: update code comment

* fix: fix pr issue

* fix: fix sql scriip style

* test: add unit test

* docs: fix sql script comment

* refactor: update auto_increment to sequence

* fix: fix cr issue

* refactor: refactor sequence create mgr

* style: fmt code style

* fix: fix pr issue

* docs: fix code comment

* fix: fix cr issue

* fix: fix sequence create table sql (#266)

* fix: compatible with new optimizer structure

* fix ut

* fix: fix sequence bug (#302)

* fix: fix sequence bug

* refactor: use lazy creat sequence

* style: fix code style

* docs: update code comment

* fix: fix pr issue

* fix: remove unuse test file

* Fix new sequence (#316)

* fix: fix sequence bug

* refactor: use lazy creat sequence

* style: fix code style

* docs: update code comment

* fix: fix pr issue

* fix: remove unuse test file

* fix: fix snowflake all even number bug

* Merge master (#320)

* add unit test. (#306)

* Add: add Range interface mock.

* Add: add test case for iterator.

* fix: format import.

* fix: fix test case error.

* Add: add test case for shard_expr.

* Add: add license header.

* Add: add new test case.

* fix: fix import format.

* refactor schemanager cache to lru cache (#246)

Co-authored-by: Dong Jianhui <dongjianhui03@meituan.com>

* optimize maxAllowedPacket config fix: #292 #281 (#297)

* insert multi value at once request, throw error msg when any row error fix: #287 (#313)

* feat: support show status (#309)

* feat: max_allowed_packet is set by the user (#312)

Co-authored-by: Zonglei Dong <dongzonglei@apache.org>
Co-authored-by: Mulavar <978007503@qq.com>
Co-authored-by: Dong Jianhui <dongjianhui03@meituan.com>
Co-authored-by: adair peng <luqiangpeng5945@gmail.com>

* style: fix code style

* ci: fix ci bug

* ci: fix ci bug

* ci: fix ci error

* fix: fix ci bug

* fix: fix runtime.Runtime use

Co-authored-by: Jeffsky <jjeffcaii@outlook.com>
Co-authored-by: Zonglei Dong <dongzonglei@apache.org>
Co-authored-by: Mulavar <978007503@qq.com>
Co-authored-by: Dong Jianhui <dongjianhui03@meituan.com>
Co-authored-by: adair peng <luqiangpeng5945@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sharding Sharding SQL SQL support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simple sequence implementation.
8 participants
0