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

crud: improvments #273

Merged
merged 5 commits into from
Mar 20, 2023
Merged

Conversation

oleg-jukovec
Copy link
Collaborator

@oleg-jukovec oleg-jukovec commented Mar 15, 2023

The patchset makes a few changes:

  1. It removes NewEncoder/NewDecoder from the public API.
  2. It change a default tuple alias from []interface{} to interface{}. This is necessary to use a custom types with custom encoders as tuples.
  3. It adds examples with a request/response processing.
  4. It removes dependency from github.com/markphelps/optional. The package gives a big overhead in benchmarks.
  5. It makes requests immutable. It is more suitable for Go & GC. See also: v3: make some types immutable #238
  6. I removed special Result* types. They don't make much sense for crud since the response format is the same.
  7. A user can specify a custom row type for Result.

I didn't forget about (remove if it is not applicable):

Related issues:

Closes #271

This is only needed for tests. Let it be private API.

Part of #271
Now a user can specify his custom type as a type for rows. The patch
also removes unnecessary types to make it easier for a user to work
with the API.

Part of #271
This is necessary to use a custom types with custom encoders as tuples.

Part of #271
In this patch, we try to make less allocations per a request.

Part of #271
@oleg-jukovec oleg-jukovec changed the title Oleg jukovec/gh 271 crud improvments crud: improvments Mar 15, 2023
Copy link
Member

@DifferentialOrange DifferentialOrange left a comment

Choose a reason for hiding this comment

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

Seems fine

crud/options.go Show resolved Hide resolved
crud/count.go Show resolved Hide resolved
@oleg-jukovec oleg-jukovec merged commit d7a422b into master Mar 20, 2023
@oleg-jukovec oleg-jukovec deleted the oleg-jukovec/gh-271-crud-improvments branch March 20, 2023 07:34
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.

Follow-ups for CRUD API
3 participants