cockroachdb

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cockroachdb provides a CockroachDB driver for Queen migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QuoteIdentifier

func QuoteIdentifier(name string) string

QuoteIdentifier quotes a SQL identifier.

Types

type Driver

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

Driver implements the queen.Driver interface for CockroachDB.

func New

func New(db *sql.DB) (*Driver, error)

New creates a new CockroachDB driver.

func NewWithTableName

func NewWithTableName(db *sql.DB, tableName string) (*Driver, error)

NewWithTableName creates a new CockroachDB driver with a custom table name.

func (*Driver) Init

func (d *Driver) Init(ctx context.Context) error

Init creates the migrations tracking table and lock table if they don't exist.

func (*Driver) Lock

func (d *Driver) Lock(ctx context.Context, timeout time.Duration) error

Lock acquires a distributed lock to prevent concurrent migrations.

func (*Driver) Unlock

func (d *Driver) Unlock(ctx context.Context) error

Unlock releases the migration lock.

Jump to

Keyboard shortcuts

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