Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDBConnection(params DBConnParams) (*sqlx.DB, error)
- func CreateDBIfNotExists(params DBConnParams) error
- func FindMxCommand(cmdName string) (cmdPath, mxDBHome string, err error)
- func GetMxbenchVersion() string
- func GetVersionStr() string
- func Intn(n int) int
- func PrintLogo(license string)
- func RestartDB() error
- func SetGUC(gucName, gucValueOnMaster, gucValueOnSegments string) error
- func ShowGUC(gucName string) (string, string, error)
- func StartMxgate(mxgatePath, arguments string) (*exec.Cmd, io.Reader, error)
- func StartMxgateStdin(mxgatePath, arguments string) (*exec.Cmd, io.WriteCloser, *bytes.Buffer, *bytes.Buffer, error)
- func StartMxgateStdinWithContext(ctx context.Context, mxgatePath, arguments string) (*exec.Cmd, io.WriteCloser, *bytes.Buffer, *bytes.Buffer, error)
- func StartMxgateWithContext(ctx context.Context, mxgatePath, arguments string) (*exec.Cmd, io.Reader, error)
- func String(length int) string
- func StringWithCharset(length int, charset string) string
- func TempDir() string
- type DBConnParams
- type DBVersion
Constants ¶
View Source
const ( CLI_BIN = "mxbench" MX_GATE_CLI_BIN = "mxgated" GP_CONFIG_CLI_BIN = "gpconfig" GP_STOP_CLI_BIN = "gpstop" MX_STOP_CLI_BIN = "mxstop" CREATEDB_CLI_BIN = "createdb" PSQL_BIN = "psql" TIME_FMT = "2006-01-02 15:04:05" TIME_WITH_TZ_FMT = "2006-01-02 15:04:05 -0700" DELIMITER = "|" ENV_KEY_MXHOME = "GPHOME" )
View Source
const (
MAJOR_VERSION_5 uint64 = 5
)
Variables ¶
View Source
var ( VersionStr string BranchStr string CommitStr string )
Functions ¶
func CreateDBConnection ¶
func CreateDBConnection(params DBConnParams) (*sqlx.DB, error)
CreateDBConnection establishes a connection to YMatrix Call Close() after use
func CreateDBIfNotExists ¶
func CreateDBIfNotExists(params DBConnParams) error
func FindMxCommand ¶
FindMxCommand locate ABS path for a matrixdb/bin executable, such as initdb or pg_ctl. It will try same dir as mxctl is located, then $PATH, finally $GPHOME
func GetMxbenchVersion ¶
func GetMxbenchVersion() string
func GetVersionStr ¶
func GetVersionStr() string
func ShowGUC ¶
Values on all segments are consistent GUC : gp_vmem_protect_limit Master value: 4096 Segment value: 8192
func StartMxgateStdin ¶
func StartMxgateWithContext ¶
func StringWithCharset ¶
Types ¶
type DBConnParams ¶
type DBConnParams struct { MasterPort int `mapstructure:"db-master-port"` MaxConnections int `mapstructure:"db-max-conn"` MasterHost string `mapstructure:"db-master-host"` User string `mapstructure:"db-user"` Database string `mapstructure:"db-database"` Password string `mapstructure:"db-password"` Options []string }
func (*DBConnParams) GetConnStr ¶
func (params *DBConnParams) GetConnStr() string
func (*DBConnParams) GetCreateDBParams ¶
func (params *DBConnParams) GetCreateDBParams() []string
type DBVersion ¶
func GetMXDBVersionFromDB ¶
func GetMXDBVersionFromDB(params DBConnParams) (DBVersion, error)
func NewMXDBVersion ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.