Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #57 by checking the
Insert()
method and providingInsertKey()
,UpsertKey()
,QueryKey()
andDeleteKey()
methods that are specifically designed to deal with primary keys.In addition, I've also improved the API for
TTL
management which is now a bit cleaner.Here's an exerpt from the documentation on the primary keys:
Using Primary Keys
In certain cases it is useful to access a specific row by its primary key instead of an index which is generated internally by the collection. For such use-cases, the library provides
Key
column type that enables a seamless lookup by a user-defined primary key. In the example below we create a collection with a primary keyname
usingCreateColumn()
method with aForKey()
column type. Then, we useInsertKey()
method to insert a value.Similarly, you can use primary key to query that data directly, without knowing the exact offset. Do note that using primary keys will have an overhead, as it requires an additional step of looking up the offset using a hash table managed internally.