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

Release 0.12.0 #305

Merged
merged 1 commit into from
Jun 28, 2022
Merged

Release 0.12.0 #305

merged 1 commit into from
Jun 28, 2022

Conversation

Totktonada
Copy link
Member

@Totktonada Totktonada commented Jun 28, 2022

Overview

This release offers support of several *_many() and *_object_many()
operations to insert/replace/upsert many tuples at once.

Those operations are faster for many tuples/operations of the same kind.
Say, if you want to add large amount of data into the cluster, invoke
insert_many() with 100 (or 1000, depends of the size) tuples per call.

Breaking changes

There are no breaking changes in the release.

New features

Example:

crud.replace_many('developers', {
  {1, box.NULL, 'Elizabeth', 'lizaaa'},
  {2, box.NULL, 'Anastasia', 'iamnewdeveloper'},
})
---
- metadata:
  - {'name': 'id', 'type': 'unsigned'}
  - {'name': 'bucket_id', 'type': 'unsigned'}
  - {'name': 'name', 'type': 'string'}
  - {'name': 'login', 'type': 'string'}
  rows:
  - [1, 477, 'Elizabeth', 'lizaaa']
  - [2, 401, 'Anastasia', 'iamnewdeveloper']
...

The *_many() operations have almost same options as
insert/replace/upsert and two new ones to control how errors are
interpreted on a storage:

  • stop_on_error (boolean, default is false)

    If an error occurs on a storage, stop processing operations of the
    request on given storage.

    Only on the storage, where the error occurs.

  • rollback_on_error (boolean, default is false)

    Rollback all changes on the storage, where an error occurs.

    Only on the storage, where the error occurs.

The operations may succeed partially, so data and errors will be
returned both. Several errors can occur at a single request: those calls
return an array of errors, where each error contains the problematic
tuple/object. Consider the README for the detailed description.

Be ready to errors that are not recoverable without interaction with a
human. This implementation does NOT perform cluster wide transactions or
two phare commit: all rollbacks are made only on particular storage.

## Overview

This release offers support of several `*_many()` and `*_object_many()`
operations to insert/replace/upsert many tuples at once.

Those operations are faster for many tuples/operations of the same kind.
Say, if you want to add large amount of data into the cluster, invoke
`insert_many()` with 100 (or 1000, depends of the size) tuples per call.

## Breaking changes

There are no breaking changes in the release.

## New features

* Insert many tuples/objects at once (#193).

  ```lua
  crud.insert_many(space_name, tuples, opts)
  crud.insert_object_many(space_name, objects, opts)
  ```
* Replace many tuples/objects at once (#193).

  ```lua
  crud.replace_many(space_name, tuples, opts)
  crud.replace_object_many(space_name, objects, opts)
  ```
* Perform many upsert operations at once (#193).

  ```lua
  crud.upsert_many(space_name, tuples_operation_data, opts)
  crud.upsert_object_many(space_name, objects_operation_data, opts)
  ```

Example:

```lua
crud.replace_many('developers', {
  {1, box.NULL, 'Elizabeth', 'lizaaa'},
  {2, box.NULL, 'Anastasia', 'iamnewdeveloper'},
})
---
- metadata:
  - {'name': 'id', 'type': 'unsigned'}
  - {'name': 'bucket_id', 'type': 'unsigned'}
  - {'name': 'name', 'type': 'string'}
  - {'name': 'login', 'type': 'string'}
  rows:
  - [1, 477, 'Elizabeth', 'lizaaa']
  - [2, 401, 'Anastasia', 'iamnewdeveloper']
...
```

The `*_many()` operations have almost same options as
insert/replace/upsert and two new ones to control how errors are
interpreted on a storage:

* `stop_on_error` (`boolean`, default is `false`)

  If an error occurs on a storage, stop processing operations of the
  request on given storage.

  **Only on the storage, where the error occurs.**
* `rollback_on_error` (`boolean`, default is `false`)

  Rollback all changes on the storage, where an error occurs.

  **Only on the storage, where the error occurs.**

The operations may succeed partially, so data and errors will be
returned both. Several errors can occur at a single request: those calls
return an array of errors, where each error contains the problematic
tuple/object. Consider the README for the detailed description.

Be ready to errors that are not recoverable without interaction with a
human. This implementation does NOT perform cluster wide transactions or
two phare commit: all rollbacks are made only on particular storage.
@Totktonada Totktonada merged commit aea0977 into master Jun 28, 2022
@Totktonada Totktonada deleted the Totktonada/release-0.12.0 branch June 28, 2022 19:28
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