db

package
v1.5.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMongoDB

func NewMongoDB(podName string) exutil.Database

NewMongoDB creates a new util.Database instance.

func NewMysql

func NewMysql(podName, masterPodName string) util.Database

NewMysql creates a new util.Database instance.

func NewPostgreSQL

func NewPostgreSQL(podName, masterPodName string) util.Database

NewPostgreSQL creates a new util.Database instance.

Types

type Channel

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

type Image

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

type MongoDB

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

MongoDB is a MongoDB helper for executing commands.

func (MongoDB) IsReady

func (m MongoDB) IsReady(oc *exutil.CLI) (bool, error)

IsReady pings the MongoDB server.

func (MongoDB) PodName

func (m MongoDB) PodName() string

PodName implements Database.

func (MongoDB) Query

func (m MongoDB) Query(oc *exutil.CLI, query string) (string, error)

Query executes a query as an ordinary user and returns the result.

func (MongoDB) QueryPrimary

func (m MongoDB) QueryPrimary(oc *exutil.CLI, query string) (string, error)

// QueryPrimary queries the database on primary node as a regular user.

func (MongoDB) QueryPrivileged

func (m MongoDB) QueryPrivileged(oc *exutil.CLI, query string) (string, error)

QueryPrivileged queries the database as a privileged user.

func (MongoDB) TestRemoteLogin

func (m MongoDB) TestRemoteLogin(oc *exutil.CLI, hostAddress string) error

TestRemoteLogin tests whether it is possible to remote login to hostAddress.

type MySQL

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

MySQL is a MySQL helper for executing commands.

func (MySQL) IsReady

func (m MySQL) IsReady(oc *exutil.CLI) (bool, error)

IsReady pings the MySQL server.

func (MySQL) PodName

func (m MySQL) PodName() string

PodName implements Database.

func (MySQL) Query

func (m MySQL) Query(oc *exutil.CLI, query string) (string, error)

Query executes an SQL query as an ordinary user and returns the result.

func (MySQL) QueryPrivileged

func (m MySQL) QueryPrivileged(oc *exutil.CLI, query string) (string, error)

QueryPrivileged executes an SQL query as a root user and returns the result.

func (MySQL) TestRemoteLogin

func (m MySQL) TestRemoteLogin(oc *exutil.CLI, hostAddress string) error

TestRemoteLogin will test whether we can login through to a remote database.

type OperatorBundle

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

type Package

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

type PodConfig

type PodConfig struct {
	Container string
	Env       map[string]string
}

PodConfig holds configuration for a pod.

type PostgreSQL

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

PostgreSQL is a PostgreSQL helper for executing commands.

func (PostgreSQL) IsReady

func (m PostgreSQL) IsReady(oc *exutil.CLI) (bool, error)

IsReady pings the PostgreSQL server.

func (PostgreSQL) PodName

func (m PostgreSQL) PodName() string

PodName implements Database.

func (PostgreSQL) Query

func (m PostgreSQL) Query(oc *exutil.CLI, query string) (string, error)

Query executes an SQL query as an ordinary user and returns the result.

func (PostgreSQL) QueryPrivileged

func (m PostgreSQL) QueryPrivileged(oc *exutil.CLI, query string) (string, error)

QueryPrivileged executes an SQL query as a root user and returns the result.

func (PostgreSQL) TestRemoteLogin

func (m PostgreSQL) TestRemoteLogin(oc *exutil.CLI, hostAddress string) error

TestRemoteLogin will test whether we can login through to a remote database.

type Sqlit

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

Sqlit is a Sqlit helper for executing commands.

func NewSqlit

func NewSqlit() *Sqlit

NewSqlit creates a new sqlit instance.

func (*Sqlit) CheckOperatorBundleNameExist

func (c *Sqlit) CheckOperatorBundleNameExist(dbFilePath string, bundleName string) (bool, error)

CheckOperatorBundleNameExist is to check the OperatorBundleName exist

func (*Sqlit) CheckOperatorBundlePathExist

func (c *Sqlit) CheckOperatorBundlePathExist(dbFilePath string, bundlepath string) (bool, error)

CheckOperatorBundlePathExist is to check the OperatorBundlePath exist

func (*Sqlit) DBHas

func (c *Sqlit) DBHas(dbFilePath string, table string, column string, valueList []string) (bool, error)

DBHas

func (*Sqlit) DBMatch

func (c *Sqlit) DBMatch(dbFilePath string, table string, column string, valueList []string) (bool, error)

DBMatch

func (*Sqlit) GetOperatorChannelByColumn

func (c *Sqlit) GetOperatorChannelByColumn(dbFilePath string, column string) ([]string, error)

GetOperatorChannelByColumn

func (*Sqlit) Query

func (c *Sqlit) Query(dbFilePath string, table string, column string) ([]string, error)

func (*Sqlit) QueryDB

func (c *Sqlit) QueryDB(dbFilePath string, query string) (*sql.Rows, error)

QueryDB executes an sqlit query as an ordinary user and returns the result.

func (*Sqlit) QueryOperatorBundle

func (c *Sqlit) QueryOperatorBundle(dbFilePath string) ([]OperatorBundle, error)

QueryOperatorBundle executes an sqlit query as an ordinary user and returns the result.

func (*Sqlit) QueryOperatorChannel

func (c *Sqlit) QueryOperatorChannel(dbFilePath string) ([]Channel, error)

QueryOperatorChannel executes an sqlit query as an ordinary user and returns the result.

func (*Sqlit) QueryPackge

func (c *Sqlit) QueryPackge(dbFilePath string) ([]Package, error)

QueryPackge executes an sqlit query as an ordinary user and returns the result.

func (*Sqlit) QueryRelatedImage

func (c *Sqlit) QueryRelatedImage(dbFilePath string) ([]Image, error)

QueryRelatedImage executes an sqlit query as an ordinary user and returns the result.

Jump to

Keyboard shortcuts

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