sqldb

package
v3.7.13 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureDBSession

func ConfigureDBSession(session db.Session, dbPool *config.ConnectionPool) db.Session

ConfigureDBSession configures the DB session

func CreateDBSession

func CreateDBSession(ctx context.Context, kubectlConfig kubernetes.Interface, namespace string, dbConfig config.DBConfig) (db.Session, error)

CreateDBSession creates the dB session

func CreateDBSessionWithCreds

func CreateDBSessionWithCreds(dbConfig config.DBConfig, username, password string) (db.Session, error)

CreateDBSessionWithCreds creates a database session using direct username and password

func Migrate

func Migrate(ctx context.Context, session db.Session, versionTableName string, changes []Change) error

Types

type AnsiSQLChange

type AnsiSQLChange string

represent a straight forward change that is compatible with all database providers

func (AnsiSQLChange) Apply

func (s AnsiSQLChange) Apply(session db.Session) error

type Change

type Change interface {
	Apply(session db.Session) error
}

func ByType

func ByType(dbType DBType, changes TypedChanges) Change

type DBType

type DBType string
const (
	MySQL    DBType = "mysql"
	Postgres DBType = "postgres"
	SQLite   DBType = "sqlite"
)

func DBTypeFor

func DBTypeFor(session db.Session) DBType

func (DBType) IntType

func (t DBType) IntType() string

type TypedChanges

type TypedChanges map[DBType]Change

Jump to

Keyboard shortcuts

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