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

refactor: add generic CrudMgr to implement various simple CRUD manager #14988

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Mar 18, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

refactor: add generic CrudMgr to implement various simple CRUD manager

CrudMgr is a generic CRUD interface for meta data operations.

  • It provide add, update, get, remove and list operations.

  • The key space it operates on is defined by the type TIdent<R>
    which contains a Tenant and a Name.

  • R: TenantResource contains essential information for such a CRUD
    manger, including key prefix, value type, and customizable error for
    unknown record and existing record.

  • A CrudMgr instance can only access keys of exactly one [Tenant].

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Refactoring

Related Issues


This change is Reviewable

@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Mar 18, 2024
@drmingdrmer drmingdrmer marked this pull request as ready for review March 18, 2024 05:49
`CrudMgr` is a generic CRUD interface for meta data operations.

- It provide `add`, `update`, `get`, `remove` and `list` operations.

- The key space it operates on is defined by the type `TIdent<R>`
  which contains a `Tenant` and a `Name`.

- `R: TenantResource` contains essential information for such a CRUD
  manger, including key prefix, value type, and customizable error for
  unknown record and existing record.

- A `CrudMgr` instance can only access keys of exactly one [`Tenant`].
@drmingdrmer drmingdrmer merged commit beba993 into databendlabs:main Mar 18, 2024
72 checks passed
@drmingdrmer drmingdrmer deleted the 25-crud-mgr branch March 18, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant