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

Added key column type #30

Merged
merged 1 commit into from
Oct 16, 2021
Merged

Added key column type #30

merged 1 commit into from
Oct 16, 2021

Conversation

kelindar
Copy link
Owner

This PR adds a new Key column type which is essentially a string column with a map[string]uint32 currently. This allows for O(1) lookups by key in case where the row offset is not known. This adds an extra map lookup of course.

  • Added UpdateAtKey() method to both transaction and collection. This allows to update or insert (upsert) an element at a specified key.
  • Added SelectAtKey() method to both transaction and collection. This allows to read a row by its key.
  • Renamed Insert() to InsertObject() and changed the signature of the existing insert methods.
  • Added Insert() and InsertWithTTL() methods that take func(column.Cursor) error instead of a map[string]interface{} to keep the API consistent and not require a map when not needed.
  • Fixed some buffer types

@kelindar kelindar merged commit cd531f7 into main Oct 16, 2021
@kelindar kelindar deleted the pk branch October 16, 2021 08:49
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.

1 participant