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:
Michał Matczuk
2020-04-20 17:39:17 +02:00
committed by Michal Jan Matczuk
parent ab279e68ed
commit 95d96fa939
13 changed files with 208 additions and 149 deletions

View File

@@ -12,4 +12,6 @@ import (
// snake case. It can be set to whatever you want, but it is encouraged to be
// set before gocqlx is used as name-to-field mappings are cached after first
// use on a type.
//
// A custom mapper can always be set per Sessionm, Query and Iter.
var DefaultMapper = reflectx.NewMapperFunc("db", reflectx.CamelToSnakeASCII)