Documentation ¶
Index ¶
- Variables
- func WithInstance(instance *sql.DB, config *Config) (database.Driver, error)
- type CockroachDb
- func (c *CockroachDb) Close() error
- func (c *CockroachDb) Drop() (err error)
- func (c *CockroachDb) Lock() error
- func (c *CockroachDb) Open(url string) (database.Driver, error)
- func (c *CockroachDb) Run(migration io.Reader) error
- func (c *CockroachDb) SetVersion(version int, dirty bool) error
- func (c *CockroachDb) Unlock() error
- func (c *CockroachDb) Version() (version int, dirty bool, err error)
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultMigrationsTable = "schema_migrations" DefaultLockTable = "schema_lock" )
View Source
var ( ErrNilConfig = fmt.Errorf("no config") ErrNoDatabaseName = fmt.Errorf("no database name") )
Functions ¶
Types ¶
type CockroachDb ¶
type CockroachDb struct {
// contains filtered or unexported fields
}
func (*CockroachDb) Close ¶
func (c *CockroachDb) Close() error
func (*CockroachDb) Drop ¶
func (c *CockroachDb) Drop() (err error)
func (*CockroachDb) Lock ¶
func (c *CockroachDb) Lock() error
Locking is done manually with a separate lock table. Implementing advisory locks in CRDB is being discussed See: https://github.com/cockroachdb/cockroach/issues/13546
func (*CockroachDb) SetVersion ¶
func (c *CockroachDb) SetVersion(version int, dirty bool) error
func (*CockroachDb) Unlock ¶
func (c *CockroachDb) Unlock() error
Locking is done manually with a separate lock table. Implementing advisory locks in CRDB is being discussed See: https://github.com/cockroachdb/cockroach/issues/13546
Click to show internal directories.
Click to hide internal directories.