Commit Graph

23 Commits

Author SHA1 Message Date
84c58f45a3 Delete everything except query builder 2025-11-20 16:09:09 +01:00
Dmitry Kropachev
38001d64ac Update gocql version to v1.16.1 (#353)
* Update gocql version to v1.16.1

1. Update gocql to v1.16.1
2. Update golang to 1.25, since new gocql version requres it

* Update golangci to 2.5.0

It is needed since 1.64.8 does not support golang 1.25.
1. Update golangci to 2.5.0
2. Migrate from golangci config v1 to v2
3. Integrate fieldaligment to golangci
4. Drop fieldaligment from Makefile
5. Address complaints
2025-10-28 14:52:22 -04:00
sylwiaszunejko
e7267922c4 Release v3 - change v2 suffix to v3
Because of recent changes there is a need for a new major
release. Changes are switching to scylladb/gocql and replacing
Unsafe with Strict mechanism.
2024-07-15 10:41:57 +02:00
sylwiaszunejko
7072863b0c Replace Unsafe with Strict mechanism
Previously by default the presence of a missing field in
a udt would result in an error reported. The Unsafe
mechanism could be used to ignore these fields.

This PR changes the default behavior to ignoring missing
fields and only reporting an error if Strict mode is used.
This approach is in line with the gocql.
2024-06-25 15:29:10 +02:00
Dmitry Kropachev
6a60650668 Marshal/Unmarshal missing UDT fields as null instead of failing in unsafe mode
We can't return an error in case a field is added to the UDT,
otherwise existing code would break by simply altering the UDT in the
database. For extra fields at the end of the UDT put nulls to be in
line with gocql, but also python-driver and java-driver.

In gocql it was fixed in d2ed1bb74f
2024-06-25 12:32:16 +02:00
Dmitry Kropachev
c6f942afc7 Introduce Unsafe method on Queryx
It enables local control over `unsafe` mode for .Bind methods of `Queryx` and iterators
spawn by it.
2024-06-25 12:32:16 +02:00
Dmitry Kropachev
ab80d70106 Update golangci-lint and turn it on in CI 2024-06-19 08:08:54 +02:00
Nikita Karmatskikh
7689c7267b format build tags according to go 1.17 2021-11-26 10:16:34 +01: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
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
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
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
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
e5688d15a8 iterx: Fix a typo in test
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2020-04-16 12:39:34 +02: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
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
Michał Matczuk
620bef0b6c workaround for gocql bug gocql/gocql#1161 2018-08-23 15:20:02 +02:00
Michał Matczuk
9cfd46fcdd gocqlxtest: test helpers extracted to separate package 2018-05-24 14:36:14 +02:00
Michał Matczuk
a8febbc71e testing: benchmarks moved to separate files 2018-05-23 09:39:22 +02:00