Documentation ¶
Index ¶
- Constants
- Variables
- func RunMigrations(log logging.Logger, mode Mode) error
- func WithInstance(session *gocql.Session, config *Config) (database.Driver, error)
- type Cassandra
- func (c *Cassandra) Close() error
- func (c *Cassandra) Drop() error
- func (c *Cassandra) Lock() error
- func (c *Cassandra) Open(url string) (database.Driver, error)
- func (c *Cassandra) Run(migration io.Reader) error
- func (c *Cassandra) SetVersion(version int, dirty bool) error
- func (c *Cassandra) Unlock() error
- func (c *Cassandra) Version() (version int, dirty bool, err error)
- type Config
- type DBConfig
- type Mode
Constants ¶
View Source
const (
LockTTLSeconds = 30
)
Variables ¶
View Source
var ( ErrNilConfig = errors.New("no config") ErrNoKeyspace = errors.New("no keyspace provided") ErrDatabaseDirty = errors.New("database is dirty") ErrClosedSession = errors.New("session is closed") )
View Source
var DefaultMigrationsTable = "schema_migrations"
View Source
var (
DefaultMultiStatementMaxSize = 10 * 1 << 20 // 10 MB
)
Functions ¶
Types ¶
type DBConfig ¶
type DBConfig struct { DBAddrs []string `envconfig:"DB_ADDRESSES" required:"true"` EntityName string `envconfig:"DB_ENTITY_NAME" required:"true"` Keyspace string `envconfig:"DB_NAME" required:"true"` DBName string `envconfig:"DB_NAME" required:"true"` // keyspace Username string `envconfig:"DB_SERVICE_USERNAME" required:"true"` Conistency string `envconfig:"CONSISTENCY" default:"ALL"` SourceURI string `envconfig:"SOURCE_URI" default:"file:///cassandra/migrations"` }
Click to show internal directories.
Click to hide internal directories.