5 Commits

Author SHA1 Message Date
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
2348379a4f reflectx: use github.com/scylladb/go-reflectx
Signed-off-by: Michał Matczuk <michal@scylladb.com>
2019-01-25 15:41:41 +01:00
Michał Matczuk
aef66f4663 reflectx: code ported from github.com/jmoiron/sqlx a2429ba
Depending on sqlx makes users pull SQL related code that is usually not
needed. Tools like dep make it easier by explicitly listing relevant
subpackages but the code needs to be downloaded anyway.
2018-05-25 11:17:07 +02:00
Michał Matczuk
9e40fcfed4 license: added license header 2017-09-21 21:43:27 +02:00
Michał Matczuk
08b131c5ee mapper: moved mapper to separate file, added snake case mapper
Performance is comparable to sting.ToLower

BenchmarkSnakeCase-4              200000              5922 ns/op            1216 B/op         97 allocs/op
BenchmarkToLower-4                300000              5418 ns/op             704 B/op         74 allocs/op
2017-07-26 11:23:17 +02:00