Skip to content

Commit

Permalink
Release 0.12.0
Browse files Browse the repository at this point in the history
## 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:

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

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

  ```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.
  • Loading branch information
Totktonada committed Jun 28, 2022
1 parent 7f84d60 commit 3ce8e54
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

### Changed

### Fixed

## [0.12.0] - 28-06-22

### Added
* Batch insert/upsert operation
`crud.insert_many()`/`crud.insert_object_many()`/
`crud.upsert_many()`/`crud.upsert_object_many()`
`crud.replace_many()`/`crud.replace_object_many()`
with partial consistency

### Changed

### Fixed

## [0.11.3] - 15-06-22

### Changed
Expand Down

0 comments on commit 3ce8e54

Please sign in to comment.