clickhouse

package
v2.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OnClusterQueryParam    = "on_cluster"
	ZooPathQueryParam      = "zoo_path"
	ClusterMacroQueryParam = "cluster_macro"
	ReplicaMacroQueryParam = "replica_macro"
)

Variables

This section is empty.

Functions

func ClearClusterParametersFromURL added in v2.4.0

func ClearClusterParametersFromURL(u *url.URL) *url.URL

func NewDriver

func NewDriver(config dbmate.DriverConfig) dbmate.Driver

NewDriver initializes the driver

Types

type ClusterParameters added in v2.4.0

type ClusterParameters struct {
	OnCluster    bool
	ZooPath      string
	ClusterMacro string
	ReplicaMacro string
}

func ExtractClusterParametersFromURL added in v2.4.0

func ExtractClusterParametersFromURL(u *url.URL) *ClusterParameters

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) MigrationsTableExists

func (drv *Driver) MigrationsTableExists(db *sql.DB) (bool, error)

MigrationsTableExists checks if the schema_migrations table exists

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) QueryError added in v2.8.0

func (drv *Driver) QueryError(query string, err error) error

Return a normalized version of the driver-specific error type.

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