forked from fl00r/go-tarantool-1.6
-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
Currently, CRUD operations in the crud module accept optional parameters via a single .Opts(...) call that takes a large struct (e.g. ReplaceObjectManyOpts). This approach has a few drawbacks:
- It forces users to construct a full struct even when only one option is needed (especially if user uses
exhaustructlinter). - It is less discoverable.
- It makes call sites more verbose and less fluent compared to method chaining.
Proposal is to replace the .Opts(...) pattern with individual builder methods for each optional field:
req := crud.MakeReplaceObjectManyRequest("my_space").
Objects(myObjects).
Timeout(5.0).
Fields("id", "name").
StopOnError(true)This style aligns better with common Go API design patterns and improves usability, especially for newcomers and interactive development.
Checklist
- Refactor all CRUD request types (InsertObjectMany, ReplaceObjectMany, etc.).
- Introduce typed setter methods for each field in the corresponding *Opts structs.
- Update tests and examples.
- Modify CHANGELOG.md and MIGRATION.md accordingly
Metadata
Metadata
Assignees
Labels
No labels