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>
This commit is contained in:
committed by
Michal Jan Matczuk
parent
ab279e68ed
commit
95d96fa939
9
iterx.go
9
iterx.go
@@ -31,15 +31,6 @@ type Iterx struct {
|
||||
values []interface{}
|
||||
}
|
||||
|
||||
// Iter creates a new Iterx from gocql.Query using a default mapper.
|
||||
func Iter(q *gocql.Query) *Iterx {
|
||||
return &Iterx{
|
||||
Iter: q.Iter(),
|
||||
Mapper: DefaultMapper,
|
||||
unsafe: DefaultUnsafe,
|
||||
}
|
||||
}
|
||||
|
||||
// Unsafe forces the iterator to ignore missing fields. By default when scanning
|
||||
// a struct if result row has a column that cannot be mapped to any destination
|
||||
// field an error is reported. With unsafe such columns are ignored.
|
||||
|
||||
Reference in New Issue
Block a user