As a Go developer working with the MySQL X DevAPI,
I want to have a chained "Add" CRUD method available in the Collection object,
So that I can efficiently add multiple data records and execute them in a single operation.
Acceptance Criteria
[x] Given that I have a Collection, when I chain the Add() method with valid data multiple times, then it should add all provided data to the collection.
[x] Given that I have a Collection, when I chain the Add() method with valid data and then call the "Execute" method, it should execute the operation and add all provided data to the collection.
[x] Given that I have a Collection, when I chain the Add() method with invalid or incomplete data, then it should store an error and not add the data to the collection and only return that error when calling Execute().
[x] Given that I have a Collection, when I chain the Add() method with valid data, it should not immediately execute the operation; instead, it should queue the data for addition.
[x] Given that I have a Collection, when I call the Execute() method after chaining the Add() method with valid data, it should execute the operation and add all queued data to the collection.
type Person struct {
Name string `json:"name"`
Age int `json:"age"`
}
myColl, _ := db.CreateCollection("my_collection");
err := myColl.Add(&Person{Name: "Laurie", Age: 19 }).
Add(&Person{Name: "Nadya", Age: 54 }, &Person{Name: "Lucas", Age: 32 }).
Execute()
Value
By adding a chained `Add() method to the MySQL X DevAPI Collection-type in Go, we enable developers to efficiently add multiple data records and execute them in a single operation.
User Story
As a Go developer working with the MySQL X DevAPI, I want to have a chained "Add" CRUD method available in the Collection object, So that I can efficiently add multiple data records and execute them in a single operation.
Acceptance Criteria
[x] Given that I have a
Collection
, when I chain theAdd()
method with valid data multiple times, then it should add all provided data to the collection.[x] Given that I have a
Collection
, when I chain theAdd()
method with valid data and then call the "Execute" method, it should execute the operation and add all provided data to the collection.[x] Given that I have a
Collection
, when I chain theAdd()
method with invalid or incomplete data, then it should store an error and not add the data to the collection and only return that error when callingExecute()
.[x] Given that I have a
Collection
, when I chain theAdd()
method with valid data, it should not immediately execute the operation; instead, it should queue the data for addition.[x] Given that I have a
Collection
, when I call theExecute()
method after chaining theAdd()
method with valid data, it should execute the operation and add all queued data to the collection.Example
Based on https://dev.mysql.com/doc/x-devapi-userguide/en/collection-add.html.
Value
By adding a chained `Add() method to the MySQL X DevAPI Collection-type in Go, we enable developers to efficiently add multiple data records and execute them in a single operation.