models

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Index

Constants

This section is empty.

Variables

View Source
var XOLog = func(string, ...interface{}) {}

XOLog provides the log func used by generated queries.

Functions

This section is empty.

Types

type AllDatabases

type AllDatabases struct {
	Datname Name // datname
}

AllDatabases represents a row from '[custom all_databases]'.

func GetAllDatabases

func GetAllDatabases(db XODB) ([]*AllDatabases, error)

GetAllDatabases runs a custom query, returning results as AllDatabases.

type ClusterInfo

type ClusterInfo struct {
	Usename        string         // usename
	Time           time.Time      // time
	ClientAddr     sql.NullString // client_addr
	ClientHostname sql.NullString // client_hostname
	Version        string         // version
	Started        time.Time      // started
	IsSlave        bool           // is_slave
}

Cluster info

func GetClusterInfos

func GetClusterInfos(db XODB) ([]*ClusterInfo, error)

GetClusterInfos runs a custom query, returning results as ClusterInfo.

type ConnectedClients

type ConnectedClients struct {
	Usename Name           // usename
	Client  sql.NullString // client
	State   sql.NullString // state
	Count   sql.NullInt64  // count
}

Connected clients list

func GetConnectedClients

func GetConnectedClients(db XODB) ([]*ConnectedClients, error)

GetConnectedClients runs a custom query, returning results as ConnectedClients.

type Connections

type Connections struct {
	State string // state
	Count int64  // count
}

Connections represents a row from '[custom connections]'.

func GetConnections

func GetConnections(db XODB) ([]*Connections, error)

GetConnections runs a custom query, returning results as Connections.

type Counters

type Counters struct {
	Datname      Name  // datname
	Numbackends  int   // numbackends
	XactCommit   int64 // xact_commit
	XactRollback int64 // xact_rollback
	BlksRead     int64 // blks_read
	BlksHit      int64 // blks_hit
	TupReturned  int64 // tup_returned
	TupFetched   int64 // tup_fetched
	TupInserted  int64 // tup_inserted
	TupUpdated   int64 // tup_updated
	TupDeleted   int64 // tup_deleted
	Conflicts    int64 // conflicts
	TempFiles    int64 // temp_files
	TempBytes    int64 // temp_bytes
	Deadlocks    int64 // deadlocks
}

Counters represents a row from '[custom counters]'.

func GetCounters

func GetCounters(db XODB) ([]*Counters, error)

GetCounters runs a custom query, returning results as Counters.

type DatabaseWaitEvents

type DatabaseWaitEvents struct {
	Relname       Name           // relname
	Relkind       uint8          // relkind
	WaitEventType sql.NullString // wait_event_type
	WaitEvent     sql.NullString // wait_event
	Datname       Name           // datname
	Count         sql.NullInt64  // count
}

DatabaseWaitEvents represents a row from '[custom database_wait_events]'.

func GetDatabaseWaitEvents

func GetDatabaseWaitEvents(db XODB) ([]*DatabaseWaitEvents, error)

GetDatabaseWaitEvents runs a custom query, returning results as DatabaseWaitEvents.

type Databases

type Databases struct {
	Datname      Name   // datname
	PgSizePretty string // pg_size_pretty
}

Databases

func GetDatabases

func GetDatabases(db XODB) ([]*Databases, error)

GetDatabases runs a custom query, returning results as Databases.

type GlobalWaitEvents

type GlobalWaitEvents struct {
	WaitEventType string // wait_event_type
	WaitEvent     string // wait_event
	Count         int64  // count
}

GlobalWaitEvents represents a row from '[custom global_wait_events]'.

func GetGlobalWaitEvents

func GetGlobalWaitEvents(db XODB) ([]*GlobalWaitEvents, error)

GetGlobalWaitEvents runs a custom query, returning results as GlobalWaitEvents.

type IndexCacheHitRatio

type IndexCacheHitRatio struct {
	Name  string          // name
	Ratio sql.NullFloat64 // ratio
}

Table cache hit ratio

func GetIndexCacheHitRatio

func GetIndexCacheHitRatio(db XODB) (*IndexCacheHitRatio, error)

GetIndexCacheHitRatio runs a custom query, returning results as IndexCacheHitRatio.

type Name

type Name string

type PortAndDatadir

type PortAndDatadir struct {
	Name    string // name
	Setting string // setting
}

PortAndDatadir represents a row from '[custom port_and_datadir]'.

func GetPortAndDatadir

func GetPortAndDatadir(db XODB) (*PortAndDatadir, error)

GetPortAndDatadir runs a custom query, returning results as PortAndDatadir.

type ScannerValuer

type ScannerValuer interface {
	sql.Scanner
	driver.Valuer
}

ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.

type ServerVersion

type ServerVersion struct {
	Version string // version
}

ServerVersion represents a row from '[custom server_version]'.

func GetServerVersion

func GetServerVersion(db XODB) (*ServerVersion, error)

GetServerVersion runs a custom query, returning results as ServerVersion.

type Setting

type Setting struct {
	Name    string // name
	Setting string // setting
}

Settings

func GetSettings

func GetSettings(db XODB) ([]*Setting, error)

GetSettings runs a custom query, returning results as Setting.

type SlaveHosts10

type SlaveHosts10 struct {
	ApplicationName sql.NullString  // application_name
	ClientAddr      sql.NullString  // client_addr
	State           sql.NullString  // state
	ByteLag         sql.NullFloat64 // byte_lag
}

SlaveHosts10 represents a row from '[custom slave_hosts10]'.

func GetSlaveHosts10s

func GetSlaveHosts10s(db XODB) ([]*SlaveHosts10, error)

GetSlaveHosts10s runs a custom query, returning results as SlaveHosts10.

type SlaveHosts96

type SlaveHosts96 struct {
	ApplicationName sql.NullString  // application_name
	ClientAddr      sql.NullString  // client_addr
	State           sql.NullString  // state
	ByteLag         sql.NullFloat64 // byte_lag
}

SlaveHosts96 represents a row from '[custom slave_hosts96]'.

func GetSlaveHosts96s

func GetSlaveHosts96s(db XODB) ([]*SlaveHosts96, error)

GetSlaveHosts96s runs a custom query, returning results as SlaveHosts96.

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

type StringSlice

type StringSlice []string

StringSlice is a slice of strings.

func (*StringSlice) Scan

func (ss *StringSlice) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface for StringSlice.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface for StringSlice.

type TableAccess

type TableAccess struct {
	Relname string         // relname
	Relkind string         // relkind
	Datname sql.NullString // datname
	Count   sql.NullInt64  // count
}

Table Access

func GetTableAccesses

func GetTableAccesses(db XODB) ([]*TableAccess, error)

GetTableAccesses runs a custom query, returning results as TableAccess.

type TableCacheHitRatio

type TableCacheHitRatio struct {
	Name  string          // name
	Ratio sql.NullFloat64 // ratio
}

Table cache hit ratio

func GetTableCacheHitRatio

func GetTableCacheHitRatio(db XODB) (*TableCacheHitRatio, error)

GetTableCacheHitRatio runs a custom query, returning results as TableCacheHitRatio.

type Tablespaces

type Tablespaces struct {
	Name     Name   // name
	Owner    Name   // owner
	Location string // location
}

Tablespaces

func GetTablespaces

func GetTablespaces(db XODB) ([]*Tablespaces, error)

GetTablespaces runs a custom query, returning results as Tablespaces.

type Unknown

type Unknown []uint8

func (Unknown) String

func (n Unknown) String() string

type XODB

type XODB interface {
	Exec(string, ...interface{}) (sql.Result, error)
	Query(string, ...interface{}) (*sql.Rows, error)
	QueryRow(string, ...interface{}) *sql.Row
}

XODB is the common interface for database operations that can be used with types from schema 'public'.

This should work with database/sql.DB and database/sql.Tx.

Jump to

Keyboard shortcuts

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