clickhouse

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(config dbmate.DriverConfig) dbmate.Driver

NewDriver initializes the driver

Types

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver provides top level database functions

func (*Driver) CreateDatabase

func (drv *Driver) CreateDatabase() error

CreateDatabase creates the specified database

func (*Driver) CreateMigrationsTable

func (drv *Driver) CreateMigrationsTable(db *sql.DB) error

CreateMigrationsTable creates the schema migrations table

func (*Driver) DatabaseExists

func (drv *Driver) DatabaseExists() (bool, error)

DatabaseExists determines whether the database exists

func (*Driver) DeleteMigration

func (drv *Driver) DeleteMigration(db dbutil.Transaction, version string) error

DeleteMigration removes a migration record

func (*Driver) DropDatabase

func (drv *Driver) DropDatabase() error

DropDatabase drops the specified database (if it exists)

func (*Driver) DumpSchema

func (drv *Driver) DumpSchema(db *sql.DB) ([]byte, error)

DumpSchema returns the current database schema

func (*Driver) InsertMigration

func (drv *Driver) InsertMigration(db dbutil.Transaction, version string) error

InsertMigration adds a new migration record

func (*Driver) Open

func (drv *Driver) Open() (*sql.DB, error)

Open creates a new database connection

func (*Driver) Ping

func (drv *Driver) Ping() error

Ping verifies a connection to the database server. It does not verify whether the specified database exists.

func (*Driver) SelectMigrations

func (drv *Driver) SelectMigrations(db *sql.DB, limit int) (map[string]bool, error)

SelectMigrations returns a list of applied migrations with an optional limit (in descending order)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL