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

### 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.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 (#193, PR #232).

## [0.11.3] - 15-06-22

### Changed
Expand Down

0 comments on commit aea0977

Please sign in to comment.