Commit Graph

237 Commits

Author SHA1 Message Date
Nikita Karmatskikh
5e98fb6f71 queryx: make bindStructArgs and bindMapArgs as methods 2021-11-26 10:16:34 +01:00
Nikita Karmatskikh
7689c7267b format build tags according to go 1.17 2021-11-26 10:16:34 +01:00
Nikita Karmatskikh
fcefd904ca Makefile: take GOPATH variable from go env 2021-11-26 10:16:34 +01:00
Nikita Karmatskikh
beeab600f9 qb: add named limit and per partition limit clauses 2021-11-23 11:42:34 +01:00
Michał Matczuk
e182c6eeff makefile: run schemagen tests 2021-11-17 12:25:21 +01:00
Michał Matczuk
8477485a45 cmd/schemagen: refactoring
- Replace log.Faltal with error wrapping in schemagen func
- Simplify tests, use temp dir and ioutil functions, remove boilerplate code
- In test use schemagen keyspace to avoid name conflict with examples
- Change template
2021-11-17 12:25:21 +01:00
Michał Matczuk
39bf42f122 go mod update to 1.17 2021-11-17 12:25:21 +01:00
Vladimir Shteinman
1bfe101568 schemagen cli 2021-11-17 09:35:27 +01:00
Michał Matczuk
979397bc5e qb: add support for USING TIMEOUT clause
In scylladb/scylla#7781 we added possibility to add timeout as part of USING spec.
This patch adds support for it by adding `Timeout` and `TimeoutNamed` functions to builders.

Fixes #194
2021-08-03 15:05:23 +02:00
Michał Matczuk
96a8de1e1e qb: using, modernize writeCql
- Add writePreamble function to handle USING vs AND usages
- Use Fprintf to avoid string allocation
2021-08-03 15:05:23 +02:00
Richard Cooper
49993c1fbb Update godoc badge link 2021-07-16 10:05:49 +02:00
Alexander Setzer
a112b4c31a Correctly state in the GetQuery comment that it gets by primary key 2021-05-25 15:11:26 +02:00
ok32
01be91c745 GetCAS: check if the query has a build error before trying to execute it 2021-05-04 10:57:09 +02:00
Michał Matczuk
d123214401 migrate: refactor examples to use the new FromFS function 2021-04-30 11:36:21 +02:00
Michał Matczuk
fe1498fe13 migrate: add support for new Go io/fs.FS
This patch adds FromFS function and lets you use the new go:embed directive to add the migration files to the binary.
Also, migration tests use an in memory FS impl instead of working with tmp directories.
2021-04-30 11:19:14 +02:00
Michał Matczuk
7980a955be github: force Go 1.16 or higher 2021-04-30 11:19:14 +02:00
Michał Matczuk
c51d7713a2 go mod update go to 1.16 2021-04-30 11:19:14 +02:00
Michał Matczuk
412899a9b2 example_test: lwtLock, add serial consistency 2020-12-03 13:37:56 +01:00
Michał Matczuk
233aa4295f example_test: Modernize with using Query(session) pattern 2020-12-03 13:37:56 +01:00
Michał Matczuk
1b6e643584 migrate: Add example 2020-12-03 13:37:56 +01:00
Michał Matczuk
9dd79fc620 migrate: Add CallbackRegister 2020-12-03 13:37:56 +01:00
Michał Matczuk
fbe7bc45b5 migrate: Remove "failed" wording from error messages 2020-12-03 13:37:56 +01:00
Michał Matczuk
d25129e2fc migrate: Add support CQL comment callbacks
This patch adds a new migration event type CallComment that it triggered by adding `-- CALL <name>;` comment in a CQL file.

Fixes #101
2020-12-03 13:37:56 +01:00
Michał Matczuk
41e4a3fa11 README: Remove leading spaces 2020-12-03 13:37:56 +01:00
Michał Matczuk
69f6f201f2 dbutil: RewriteTable, generalize table.RewriteRows to copy from source table to destination table with row transformation 2020-12-03 10:48:23 +01:00
Michał Matczuk
13ef8ceaf1 table: Add RewriteRows 2020-10-30 16:38:07 +01:00
Michał Matczuk
bc762ebc01 table: Add SelectAll 2020-10-30 16:38:07 +01:00
Michał Matczuk
5a48acca36 table: Add InsertBuilder 2020-10-30 16:38:07 +01:00
Michał Matczuk
7d3868d381 github: Migrate from travis to GH actions 2020-10-30 16:38:07 +01:00
Maciej Zimnoch
4ea6f42a51 Added Context variants of Query functions 2020-06-19 11:13:21 +02:00
Maciej Zimnoch
8af6506cde table: add GetQuery shortcut to Queryx 2020-06-19 11:13:21 +02:00
Maciej Zimnoch
4f4f94e2e6 qb: Added shortcuts to Queryx
It allows to write shorter and more straightforward code.
Instead writing:

```
session.Query(qb.Select("cluster").Columns("id").ToCql())
```

you can write:

```
qb.Select("cluster").Columns("id").Query(session)
```
2020-06-17 16:44:48 +02:00
Maciej Zimnoch
564db08698 table: Added shortcuts to Queryx
These shortucuts allows to write shorter more straightforward code.
It allows to write:

```
clusters.InsertQuery(session).BindStruct(r).ExecRelease()
```

instead of:

```
tmt, names := clusters.Insert()
session.Query(stmt,names).BindStruct(r).ExecRelease()
```
2020-06-17 16:44:48 +02:00
Michal Jan Matczuk
009b5ec4b5 Update README.md 2020-06-09 09:19:13 +02:00
xiang.wang
1083dcf024 qb.BatchBuilder: Remove deprecated flag and add comments on its limitation and warning 2020-06-05 15:46:37 +02:00
xiang.wang
d76ea6c678 Specify explicitly that use gocql.Session.NewBatch instead of the deprecated BatchBuilder. 2020-05-29 13:05:01 +02:00
xiang.wang
b79c395c11 Specify explicitly that use gocqlx.Session.Qury API insteawd of the deprecated Query API 2020-05-29 12:39:24 +02:00
Michał Matczuk
ae6d066255 Add NewSession function
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-05-21 14:04:36 +02:00
Michal Jan Matczuk
a721151829 Update README.md 2020-05-13 14:09:00 +02:00
Michał Matczuk
cea42f14c7 Update tests to use v2
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-29 10:54:39 +02:00
Michal Jan Matczuk
e90337b9ca Update README.md 2020-04-29 09:35:08 +02:00
Michal Jan Matczuk
fa54f5347b Add go module v2 suffix
Fixes #153
2020-04-29 09:27:42 +02:00
Michal Jan Matczuk
507391a34c Update README.md 2020-04-23 17:44:01 +02:00
Michał Matczuk
0675f72f4f Updated examples and README for 2.0
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-23 16:23:30 +02:00
Michał Matczuk
227d152ac2 iterx: Minor test refactoring
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-22 12:16:33 +02:00
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