6 Commits

Author SHA1 Message Date
84c58f45a3 Delete everything except query builder 2025-11-20 16:09:09 +01: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
sylwiaszunejko
a222c1f067 Marshal missing UDT fields as null instead of failing
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
ab80d70106 Update golangci-lint and turn it on in CI 2024-06-19 08:08:54 +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