migrate: Add support CQL comment callbacks
This patch adds a new migration event type CallComment that it triggered by adding `-- CALL <name>;` comment in a CQL file. Fixes #101
This commit is contained in:
committed by
Michal Jan Matczuk
parent
41e4a3fa11
commit
d25129e2fc
@@ -2,15 +2,13 @@
|
||||
|
||||
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.
|
||||
There is no imposed naming schema, migration name is file name and the migrations are processed in lexicographical order.
|
||||
Caller provides a `gocqlx.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
|
||||
* Go code migrations using callbacks
|
||||
|
||||
## Example
|
||||
|
||||
@@ -20,7 +18,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/scylladb/gocqlx/migrate"
|
||||
"github.com/scylladb/gocqlx/v2/migrate"
|
||||
)
|
||||
|
||||
const dir = "./cql"
|
||||
|
||||
Reference in New Issue
Block a user