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

eth: Migrate transaction DB to Lexi #3213

Merged
merged 2 commits into from
Mar 19, 2025
Merged

Conversation

martonp
Copy link
Collaborator

@martonp martonp commented Mar 16, 2025

    lexi: Add unique index support
    
    - Implements unique index creation for tables
    - Prevents insertion of duplicate entries on unique indexes
    - Supports replacement of existing conflicting entries when `Set`
      is called with `WithReplace`
    eth: Migrate transaction DB to Lexi
    
    - No functional changes, but this is needed for various upcoming features
    - On `Connect`, if a legacy DB is found, all the entries are inserted into
      a new Lexi DB, and the legacy DB is deleted.

This is required for both bridging and gasless redeems.

martonp added 2 commits March 16, 2025 16:17
- Implements unique index creation for tables
- Prevents insertion of duplicate entries on unique indexes
- Supports replacement of existing conflicting entries when `Set`
  is called with `WithReplace`
- No functional changes, but this is needed for various upcoming features
- On `Connect`, if a legacy DB is found, all the entries are inserted into
  a new Lexi DB, and the legacy DB is deleted.
Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Looks and tests great.

Comment on lines +318 to +320
if !strings.Contains(err.Error(), "index uniqueness violation") {
t.Fatalf("Expected unique index error, got: %v", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

Could implement errors.Is if this will be used in code.

@buck54321 buck54321 merged commit f667785 into decred:master Mar 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants