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

Allow any string for ID column, and support collections without an updated column #71

Merged
merged 22 commits into from
Jun 30, 2023

Conversation

peterbroadhurst
Copy link
Contributor

@peterbroadhurst peterbroadhurst commented Jun 8, 2023

Couple of updates/enhancements found to be required while working on FFTM/EVMConnect:

  1. Allowing any string for ID
  • The default example ResourceBase still uses fftypes.UUID
  • This allows FFTM to use the namesace:UUID convention from FF Core (established historically)
  1. Allowing collections without an updated column
  • The previous code allowed you to map the created/updated columns to any fields in your business object, but required them. This was a pain for write-or-delete-only data, which is true for performance sensitive transaction history records in FFTM/EVMConnect
  1. Ensuring large integers are sortable in the DB
    • Uses zero padding on the already hex storage of the data. This was required for nonce sorting, but will have benefits in other places in the FireFly ecosystem. For example in Core it will be possible to sort account balances etc.
  2. Add DeleteMany operation to CRUD
    • This wasn't added before because it can't generate events, but I found the lack of it was a big pain. So I've added it with the caveat that it still doesn't generate change events.
  3. Add Count operation to CRUD
    • Just a simple omission as not predicted to be required before
  4. Add features to support externalizing the seq column in flexible ways
    • An interface to set it into the object on insert/query
    • The ability to query the raw sequence integer in an efficient way for all objects
  5. Allows REST API Filter for multiple conditions on a single value combine with AND optionally, rather than OR as is the default
    • This is required for a time range, with a start and an end
    • I went for using the[ modifier for AND modifier, and and ] for OR allowing you to do:
      • ?created=[>12345&created=[<23456 - AND
      • ?created=[]>12345&created=[]<23456 - OR (explicit - because second modifier overrides first)
      • ?created=]>12345&created=]<23456 - OR (explicit)
      • ?created=>12345&created=<23456 - OR (implicit)

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2023

Codecov Report

Merging #71 (9066e70) into main (6815651) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              main       #71    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           63        63            
  Lines         4654      4778   +124     
==========================================
+ Hits          4654      4778   +124     
Impacted Files Coverage Δ
pkg/i18n/en_base_error_messages.go 100.00% <ø> (ø)
pkg/cache/cache.go 100.00% <100.00%> (ø)
pkg/dbsql/crud.go 100.00% <100.00%> (ø)
pkg/dbsql/filter_sql.go 100.00% <100.00%> (ø)
pkg/ffapi/filter.go 100.00% <100.00%> (ø)
pkg/ffapi/query_fields.go 100.00% <100.00%> (ø)
pkg/ffapi/restfilter.go 100.00% <100.00%> (ø)
pkg/fftypes/bigint.go 100.00% <100.00%> (ø)
pkg/fftypes/timeutils.go 100.00% <100.00%> (ø)

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Chengxuan and others added 2 commits June 24, 2023 12:54
Signed-off-by: Chengxuan Xing <chengxuan.xing@kaleido.io>
@peterbroadhurst peterbroadhurst marked this pull request as ready for review June 26, 2023 17:57
peterbroadhurst and others added 5 commits June 26, 2023 17:43
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Provide alternative operation mode for cache for code users
Provide alternative operation mode for cache for code users
@Chengxuan Chengxuan mentioned this pull request Jun 29, 2023
peterbroadhurst and others added 5 commits June 29, 2023 17:14
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Add behaviors to cache rather than muddying the Get function
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
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.

4 participants