Skip to content

Commit fde7dd7

Browse files
committed
api: add CRUD module support
This patch provides crud [1] methods as request objects to support CRUD API. The following methods are supported: * `insert` * `insert_object` * `insert_many` * `insert_object_many` * `get` * `update` * `delete` * `replace` * `replace_object` * `replace_many` * `replace_object_many` * `upsert` * `upsert_object` * `upsert_many` * `upsert_object_many` * `select` * `min` * `max` * `truncate` * `len` * `storage_info` * `count` * `stats` * `unflatten_rows` 1. https://github.com/tarantool/crud Closes #108
1 parent a22527a commit fde7dd7

File tree

8 files changed

+2685
-0
lines changed

8 files changed

+2685
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
1212

1313
- Support pagination (#246)
1414
- A Makefile target to test with race detector (#218)
15+
- Support CRUD API (#108)
1516

1617
### Changed
1718

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ endif
2222
.PHONY: clean
2323
clean:
2424
( cd ./queue; rm -rf .rocks )
25+
( cd ./crud; rm -rf .rocks )
2526
rm -f $(COVERAGE_FILE)
2627

2728
.PHONY: deps
2829
deps: clean
2930
( cd ./queue/testdata; $(TTCTL) rocks install queue 1.2.1 )
31+
( cd ./crud; $(TTCTL) rocks install crud 0.14.1 )
3032

3133
.PHONY: datetime-timezones
3234
datetime-timezones:
@@ -99,6 +101,13 @@ test-settings:
99101
go clean -testcache
100102
go test -tags "$(TAGS)" ./settings/ -v -p 1
101103

104+
.PHONY: test-crud
105+
test-crud:
106+
@echo "Running tests in crud package"
107+
cd ./crud/ && tarantool -e "require('crud')"
108+
go clean -testcache
109+
go test -tags "$(TAGS)" ./crud/ -v -p 1
110+
102111
.PHONY: test-main
103112
test-main:
104113
@echo "Running tests in main package"

crud/msgpack.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build !go_tarantool_msgpack_v5
2+
// +build !go_tarantool_msgpack_v5
3+
4+
package crud
5+
6+
import (
7+
"gopkg.in/vmihailenco/msgpack.v2"
8+
)
9+
10+
type encoder = msgpack.Encoder

crud/msgpack_v5.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build go_tarantool_msgpack_v5
2+
// +build go_tarantool_msgpack_v5
3+
4+
package crud
5+
6+
import (
7+
"github.com/vmihailenco/msgpack/v5"
8+
)
9+
10+
type encoder = msgpack.Encoder

0 commit comments

Comments
 (0)