-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
75 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# GoCQLX Migrations | ||
|
||
Package `migrate` provides simple and flexible CQL migrations. | ||
Migrations can be read from a flat directory containing cql files. | ||
There is no imposed naming schema, migration name is file name and the | ||
migrations are processed in lexicographical order. Caller provides a | ||
`gocql.Session`, the session must use a desired keyspace as migrate would try | ||
to create migrations table. | ||
|
||
## Features | ||
|
||
* Each CQL statement will run once | ||
* Go code migrations using callbacks | ||
|
||
## Example | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/scylladb/gocqlx/migrate" | ||
) | ||
|
||
const dir = "./cql" | ||
|
||
func main() { | ||
session := CreateSession() | ||
defer session.Close() | ||
|
||
ctx := context.Background() | ||
if err := migrate.Migrate(ctx, session, dir); err != nil { | ||
panic(err) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# GoCQLX Query Builder | ||
|
||
Package `qb` provides CQL query builders. The builders create CQL statement | ||
and a list of named parameters that can later be bound using `gocqlx`. | ||
|
||
The following CQL commands are supported: `SELECT`, `INSERT`, `UPDATE`, `DELETE` and `BATCH`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters