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>
This commit is contained in:
committed by
Michal Jan Matczuk
parent
2569c3dd8f
commit
ab279e68ed
@@ -180,6 +180,13 @@ func bindMapArgs(names []string, arg map[string]interface{}) ([]interface{}, err
|
||||
return arglist, nil
|
||||
}
|
||||
|
||||
// Bind sets query arguments of query. This can also be used to rebind new query arguments
|
||||
// to an existing query instance.
|
||||
func (q *Queryx) Bind(v ...interface{}) *Queryx {
|
||||
q.Query.Bind(udtWrapSlice(q.Mapper, DefaultUnsafe, v)...)
|
||||
return q
|
||||
}
|
||||
|
||||
// Err returns any binding errors.
|
||||
func (q *Queryx) Err() error {
|
||||
return q.err
|
||||
|
||||
Reference in New Issue
Block a user