Commit Graph

242 Commits

Author SHA1 Message Date
Maciej Zimnoch
52c5f6873a queryx: Added CAS functions (#98)
Added ExecCAS, ExecCASRelease, GetCAS, GetCASRelease functions
suitable for INSERT ... IF NOT EXISTS and UPDATE's containing IF statement.
Functions returns information wheter query was applied or not, together
with pre-image.

Fixes #98
2020-04-22 11:57:35 +02:00
Michał Matczuk
9655ae5b49 qb: Deprecate Batch in favour of session.NewBatch
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-22 10:09:23 +02:00
Michał Matczuk
33e08981ad queryx: Add test to check that all methods are wrapped
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-21 15:35:39 +02:00
Michał Matczuk
6f3b4bc8e5 tavis: Bump Scylla version to 4.0.rc1
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-21 15:13:16 +02:00
Michał Matczuk
33ae600ba4 Modernised tests
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-21 11:36:42 +02:00
Michał Matczuk
95d96fa939 Merge pull request #3 from hailocab/upstream-merge
Upstream merge
Add Session wrapper

With this patch we can now use gocqlx like:

```
session.Query(`SELECT * FROM struct_table`, nil).Get(&v)
```

instead of (old format):

```
gocqlx.Query(session.Query(`SELECT * FROM struct_table`), nil).Get(&v)
```

Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-21 10:07:45 +02:00
Michał Matczuk
ab279e68ed Automated UDT support
This patch adds the power of GocqlX to UDTs.
Now you can make a struct be UDT compatible by adding a single line.

```
type FullName struct {
	gocqlx.UDT
	FirstName string
	LastName  string
}
```

Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-21 09:41:41 +02:00
Michał Matczuk
2569c3dd8f makefile: moved running Scylla to makefile target
- Modernised Makefile
- Scylla and go bench run on separate CPUs

Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-17 15:13:21 +02:00
Michał Matczuk
1e766b10c9 Update benchmark results in README
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-17 15:08:25 +02:00
Martin Sucha
a08a66ee85 iterx: Allow forcing scanning as struct
We have a structure type that implements UnmarshalCQL method.
We use it to unmarshal a user defined type. We also want to use the same struct for scanning an entire row.

There is StructScan method available in gocqlx for this purpose when iterating over rows, but no equivalent when doing a Select.
This commit introduces the possibility when doing select/get as well.

Co-authored-by: Michał Matczuk <michal@scylladb.com>
2020-04-17 09:26:48 +02:00
Michał Matczuk
a9ce16bfc6 iterx: Refactor DefaultUnsafe handling
Assign unsafe from DefaultUnsafe and simplify condition.

Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 13:04:13 +02:00
Michał Matczuk
92c739c2db makefile: Update golang CI lint
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02:00
Michał Matczuk
e796a82d11 makefile: Disable test cache
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02:00
Michał Matczuk
17f58c5605 travis: Add scylla version env variable
- Added SCYLLA_VERSION=latest

Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02:00
Michał Matczuk
710f921b79 Remove deprecated top level functions Get and Select
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02:00
Michał Matczuk
7c0a35d621 iterx: Move isScannable to Iterx
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02:00
Michał Matczuk
bd53297a6c iterx: Change field order
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02:00
Michał Matczuk
e5688d15a8 iterx: Fix a typo in test
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02:00
Michał Matczuk
2c5ac087ec iterx: Improve error messages 2020-04-16 12:39:34 +02:00
Michał Matczuk
4b8b455fa0 benchmark: Update benchmark
- Run on a single CPU
- Moved query initialisation outside the timed zone

Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02:00
xiang.wang
27c388ea32 table: Added PrimaryKeyCmp() which returns copy of table's primaryKeyCmp. 2020-04-08 09:23:19 +02:00
xiang.wang
fc0b7be8ab table: Added cql.builders for insert, update, delete to enable table batch timestamp at statement granularity. 2020-03-19 09:40:56 +01:00
Aleksandar Jankovic
ab2a96d9f3 table: fix data race in select builder usage
When table is used with SelectBuilder it triggers data race on Where()
condition usage.

This change copies underlining slices on table creation to allow safe
concurrent usage of the table.
2020-02-25 16:36:59 +02:00
Guy
c36e6c5e66 added training information to readme file 2020-02-10 09:38:36 +01:00
Daniel Lohse
ed4fad9742 Add DefaultAwaitSchemaAgreement option (disabled by default)
Depending on what is set, schema agreement is checked before each file or before each statement.
Awaiting schema agreement after every migration has run is always done.
2020-02-05 15:23:06 +01:00
Daniel Lohse
0ee9ef8bda Update gocql version to the latest master 2020-02-05 15:23:06 +01:00
Daniel Lohse
12fcad241d Fix resetting DefaultUnsafe option after the DefaultUnsafe select test 2020-01-15 16:31:47 +01:00
Daniel Lohse
a471f98eed Add DefaultUnsafe global
Setting it to true will enable Iter's `Unsafe()` behavior for all queries.
2020-01-15 15:24:45 +01:00
Michał Matczuk
0f06ab790c go mod tidy
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-01-07 16:01:17 +01:00
Michał Matczuk
3cba305eef Revert "Replace gocql => github.com/scylladb/gocql"
This reverts commit 3e60935d2a.
2020-01-07 15:59:15 +01:00
Gian Lorenzo Meocci
45d3524bc1 remove empty line in git ignore 2019-12-16 11:14:11 +01:00
Gian Lorenzo Meocci
9239d9c4b4 add UseColums function to avoid extra allocation performed by Colums function
fix name

tidy

adding SetWhere

adding SetWhere

fix go mod

fix comment style

revert go mod

Avoid to append if no needed

fix git ignore

revert change in go.sum/go.mod

adding specific benchmark
2019-12-16 11:14:11 +01:00
Michał Matczuk
a57d58f38f Iterx inherit mapper from Queryx
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2019-11-08 23:57:04 +01:00
Michał Matczuk
1f3032a787 Travis updated Go and Scylla version
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2019-11-07 16:13:50 -08:00
Michał Matczuk
1668ca5832 Updated golandci-lint to 1.21.0
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2019-11-07 16:13:50 -08:00
Michał Matczuk
3e60935d2a Replace gocql => github.com/scylladb/gocql
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2019-11-07 16:13:50 -08:00
Michał Matczuk
c4a576ccbb Added vendor dir to .gitignore
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2019-11-07 16:13:50 -08:00
pierDipi
180d58ce46 Move ne comparator below eq comparator (#119)
qb: Move ne comparator below eq comparator

Signed-off-by: pierdipi <pierangelodipilato@gmail.com>
2019-11-07 06:29:21 -08:00
Henrik Johansson
8a02fca018 Merge pull request #116 from pierDipi/not-equal
Add not equal comparators (!=)
2019-11-04 16:13:41 +01:00
pierdipi
6f13526544 Add not equal comparator (!=)
The `qb.Cmp` lacks `not equal` methods related to the operator `!=`
even though the documentation
https://docs.scylladb.com/getting-started/dml/#select-statement mentions
it.

Closes: #114

Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
2019-11-03 10:01:59 +01:00
Martin Sucha
75adfd59ee Add support for BYPASS CACHE
This commit adds support for BYPASS CACHE extension that is present in
ScyllaDB since 3.1 / 2019.1.1.

https://docs.scylladb.com/getting-started/dml/#bypass-cache
2019-09-17 09:35:54 +02:00
Christoph Oelmueller
dd98b0e363 add token value comparer to TokenBuilder (#112)
qb: add token value comparer to TokenBuilder
2019-08-29 14:59:43 +02:00
Henrik Johansson
8b6f083cdc iterx: paging iteration working
We used to rely upon NumRows to determine if there are
new pages available. This is not correct since the server
is allowed to return empty pages with has_more_data flag
set and the needed data to do this is not exposed by
the gocql driver.

We simply remove these checks and let the driver decide
when to stop reading.

Co-authored-by: Henrik Johansson <henrik@scylladb.com>
Co-authored-by: Piotr Sarna <sarna@scylladb.com>
2019-06-03 11:19:43 +02:00
Henrik Johansson
eddedae353 scylla: bump version to 3.0 2019-06-03 11:19:43 +02:00
Henrik Johansson
1fda6f1e29 qb: tuples now returns the correct names
The names are auto generated in the form param_0, param_1, ...
2019-05-14 11:24:25 +02:00
Henrik Johansson
219bceab51 qb: tuple support 2019-05-14 09:12:06 +02:00
Henrik Johansson
31ae81aba6 qb: json support 2019-05-14 08:52:59 +02:00
Henrik Johansson
eadf9b5427 mod: dependencies updated 2019-05-14 08:52:59 +02:00
Vishal Rana
3a6a3da0c7 Updated deps
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-04-24 09:37:01 +02:00
Henrik Johansson
a1f46eced2 Merge pull request #97 from scylladb/bump_go_reflectx_version
reflectx: bump go-reflectx version to v1.0.1
2019-03-28 13:55:49 +01:00