Commit Graph

39 Commits

Author SHA1 Message Date
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
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
Michał Matczuk
d20fd5b39c qb: fix formatting
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2019-01-25 15:41:41 +01:00
Maxim Karelov
6100d3b4c2 Add qb.Like to query keys 2019-01-14 21:41:24 +01:00
Marian Gappa
87976451ed test(qb): Add tests for qb section (#74)
test(qb): Add missing tests for qb directory

* Add a GROUP BY test without Columns
* Add LtFunc test
* Add LtOrEqFunc test
* Add GtFunc test
* Add GtOrEqFunc test
* Add a Select with a AS between one column test
* Add a Order By DESC test
* Add Sum test
* Add Avg test
* Add Max test
* Add 2 tests for FuncColumn
* Add SetNamed test
* Add AddFunc test
* Add RemoveFunc test
* Add TTL and TimestampNamed test
* Add TTLNamed and Timestamp test
* Add TTL with negative or no duration test
* Add LtFunc test
* Add LtOrEqFunc test
* Add GtFunc test
* Add GtOrEqFunc test
* Add a Select with a AS between one column test
* Add a Order By DESC test
* Add Sum test
* Add Avg test
* Add Max test
* Add SetNamed test
* Add AddFunc test
* Add RemoveFunc test
* Add TTL and TimestampNamed test
* Add TTLNamed and Timestamp test
* Add TTL with negative or no duration test
* Add LtFunc test
* Add LtOrEqFunc test
* Add GtFunc test
* Add GtOrEqFunc test
* Add a Select with a AS between one column test
* Add a Order By DESC test
* Add Sum test
* Add Avg test
* Add Max test
* Add 2 tests for FuncColumn
* Add SetNamed test
* Add AddFunc test
* Add RemoveFunc test
* In qb/select.go, if there are no colums and the query have a GroupBy
statement then the query will be malformated.
* In qb/utils.go, refactor writeCql with a strings.Join call.

Fixes #78
2018-12-17 15:40:03 +01:00
Michal Matczuk
b7e4f7e8b7 qb: insert support order by multiple columns (#79)
Fixes #78
2018-11-15 11:55:45 +01:00
sagarafr
a503f75a9c fix(perf): Fixed performance
* Performance are better when you write columns byte by
byte rather than string generation
2018-11-09 16:32:05 +01:00
sagarafr
ec81eea1fc test(qb): Add GROUP BY test
* Add a GROUP BY test without Columns
2018-11-09 16:32:05 +01:00
sagarafr
19dedfc6a0 fix(qb): Fixed group by generation
* In qb/select.go, if there are no colums and the query have a GroupBy
statement then the query will be malformated.
* In qb/utils.go, refactor writeCql with a strings.Join call.
2018-11-09 16:32:05 +01:00
Vincent Rischmann
2f13a81c46 Add qb.ContainsKey to query keys in a map (#57)
qb: add ContainsKey and ContainsKeyNamed
2018-07-28 06:56:44 +02:00
Michał Matczuk
d5caed56c3 readme: updated docs 2018-05-25 14:20:59 +02:00
Michał Matczuk
fa402f3f0c qb: using ttl timestamp
Fixes: #40
2018-05-25 14:05:55 +02:00
Michał Matczuk
a8febbc71e testing: benchmarks moved to separate files 2018-05-23 09:39:22 +02:00
Michał Matczuk
cca99d4a42 makefile: added megacheck 2018-05-22 15:03:59 +02:00
SpiritOfWill
5526e60464 Add aggregation function to select query builder (#39)
qb: added min, max, avg, sum, and count to SelectBuilder
2018-05-15 14:07:35 +02:00
Josh Giles
12d360a0c3 Support for literals in INSERT and UPDATE and comparisons
The 'value' interface represents a CQL value for use in a comparison,
update, or intitialization operation. A consistent interface for this
allows us to easily support specifying default-named, custom-named,
literal, and evaluated-function values in all these contexts.

Parameters to Func should probably also be values to support full
composition, but that would be a breaking change because Func's
properties are exposed.

The value interface could itself be exposed if we wanted to allow
clients to pass their own values to SetValue, etc, but for now it is a
package-internal abstraction.

BLA
2018-04-20 14:52:47 +02:00
Eric Renard
9fa5432a65 fix query order when using ttl and unique 2017-12-28 11:16:54 +01:00
Josh Giles
6051038fa5 Add ColumnAs for 'SELECT col AS name' queries. (#24)
Add As helper for 'SELECT col AS name' queries

Clients could do this hackily before by manually passing "col AS name",
but it isn't clearly supported.
2017-12-15 09:53:37 +01:00
Michał Matczuk
cdb91625bf qb: batch add ability to add raw statements 2017-11-16 13:08:23 +01:00
Michał Matczuk
557674a886 qb: update builder advanced assignments 2017-09-22 09:48:19 +02:00
Michał Matczuk
fdb26806a9 qb: extracted function from cmp 2017-09-22 09:35:02 +02:00
Michał Matczuk
9e40fcfed4 license: added license header 2017-09-21 21:43:27 +02:00
Michał Matczuk
c4886ff8da batch: extracted AddWithPrefix 2017-08-30 16:26:30 +02:00
Michał Matczuk
ea8a9e9845 cmp: token builder 2017-08-30 16:05:14 +02:00
Michał Matczuk
2e903a54e0 cmp: functions support 2017-08-30 16:05:14 +02:00
Michał Matczuk
ff828f9198 notice update 2017-08-24 09:56:45 +02:00
Michał Matczuk
804cfad37c qb: batch builder 2017-08-03 18:46:29 +02:00
Michał Matczuk
8d47a6d133 qb: fixed benchmarks 2017-08-03 17:02:22 +02:00
Michał Matczuk
fd4e0be6c8 BindStruct, BindStructMap, BindStructMap returns *Queryx 2017-08-02 11:16:31 +02:00
Michał Matczuk
906f9433fe qb: TTL and Timestamp named parameters 2017-08-02 10:24:27 +02:00
Michał Matczuk
41bb8def2a qb: doc 2017-07-31 15:30:26 +02:00
Michał Matczuk
3b3c7087d2 qb: interface 2017-07-28 12:11:43 +02:00
Michał Matczuk
eb033c4922 qb: removed error from builder ToCql function
Builder is not in a position to validate the statement and the effort is
duplicated when the query is build. The checked errors are simple and
do not occur most of the time.
2017-07-28 12:11:43 +02:00
Michał Matczuk
2afe71e2b9 qb: cmp 2017-07-28 12:11:39 +02:00
Michał Matczuk
546e11d58f qb: select 2017-07-28 12:10:50 +02:00
Michał Matczuk
69dad13e4b qb: update, delete and performance improvements 2017-07-27 15:08:09 +02:00
Michał Matczuk
5db5de8822 qb: insert 2017-07-27 15:08:09 +02:00