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

@@ -7,7 +7,7 @@ package migrate
import (
"context"
"github.com/gocql/gocql"
"github.com/scylladb/gocqlx"
)
// CallbackEvent specifies type of the event when calling CallbackFunc.
@@ -21,7 +21,7 @@ const (
// CallbackFunc enables interrupting the migration process and executing code
// while migrating. If error is returned the migration is aborted.
type CallbackFunc func(ctx context.Context, session *gocql.Session, ev CallbackEvent, name string) error
type CallbackFunc func(ctx context.Context, session gocqlx.Session, ev CallbackEvent, name string) error
// Callback is called before and after each migration.
// See CallbackFunc for details.