Documentation
¶
Index ¶
- Constants
- Variables
- func ObjectsFromResult(res *Result) map[string]*Objects
- func SetBinaryCodec(codec string) error
- type Client
- func (client *Client) Activity() (*Result, error)
- func (client *Client) Close() error
- func (client *Client) Databases() ([]string, error)
- func (client *Client) EstimatedTableRowsCount(table string, opts RowsOptions) (*Result, error)
- func (client *Client) Function(id string) (*Result, error)
- func (client *Client) GetConnContext() (*ConnContext, error)
- func (client *Client) Info() (*Result, error)
- func (c *Client) IsClosed() bool
- func (client *Client) IsIdle() bool
- func (c *Client) LastQueryTime() time.Time
- func (client *Client) MaterializedView(name string) (*Result, error)
- func (client *Client) Objects() (*Result, error)
- func (client *Client) Query(query string) (*Result, error)
- func (client *Client) Schemas() ([]string, error)
- func (client *Client) ServerSettings() (*Result, error)
- func (client *Client) ServerVersion() string
- func (client *Client) ServerVersionInfo() string
- func (client *Client) SetReadOnlyMode() error
- func (client *Client) Table(table string) (*Result, error)
- func (client *Client) TableConstraints(table string) (*Result, error)
- func (client *Client) TableIndexes(table string) (*Result, error)
- func (client *Client) TableInfo(table string) (*Result, error)
- func (client *Client) TableRows(table string, opts RowsOptions) (*Result, error)
- func (client *Client) TableRowsCount(table string, opts RowsOptions) (*Result, error)
- func (client *Client) TablesStats() (*Result, error)
- func (client *Client) Test() error
- func (client *Client) TestWithTimeout(timeout time.Duration) (result error)
- type ConnContext
- type Dump
- type Object
- type Objects
- type Pagination
- type Result
- type ResultStats
- type Row
- type RowsOptions
- type Tunnel
Constants ¶
View Source
const ( CodecNone = "none" CodecHex = "hex" CodecBase58 = "base58" CodecBase64 = "base64" )
View Source
const ( ObjTypeTable = "table" ObjTypeView = "view" ObjTypeMaterializedView = "materialized_view" ObjTypeSequence = "sequence" ObjTypeFunction = "function" )
Variables ¶
View Source
var ( ErrAuthFailed = errors.New("authentication failed") ErrConnectionRefused = errors.New("connection refused") ErrDatabaseNotExist = errors.New("database does not exist") )
View Source
var ( // BinaryCodec sets the serialization format of binary data BinaryCodec = CodecBase64 )
Functions ¶
func ObjectsFromResult ¶ added in v0.9.0
func SetBinaryCodec ¶ added in v0.11.10
Types ¶
type Client ¶
type Client struct {
External bool `json:"external"`
History []history.Record `json:"history"`
ConnectionString string `json:"connection_string"`
// contains filtered or unexported fields
}
func NewFromBookmark ¶ added in v0.13.0
func (*Client) EstimatedTableRowsCount ¶ added in v0.10.0
func (client *Client) EstimatedTableRowsCount(table string, opts RowsOptions) (*Result, error)
func (*Client) GetConnContext ¶ added in v0.14.0
func (client *Client) GetConnContext() (*ConnContext, error)
ConnContext returns information about current database connection
func (*Client) LastQueryTime ¶ added in v0.12.0
func (*Client) MaterializedView ¶ added in v0.9.0
func (*Client) ServerSettings ¶ added in v0.17.0
func (*Client) ServerVersion ¶ added in v0.9.9
func (*Client) ServerVersionInfo ¶ added in v0.12.0
func (*Client) SetReadOnlyMode ¶ added in v0.9.6
func (*Client) TableConstraints ¶ added in v0.7.0
func (*Client) TableRows ¶
func (client *Client) TableRows(table string, opts RowsOptions) (*Result, error)
func (*Client) TableRowsCount ¶ added in v0.8.0
func (client *Client) TableRowsCount(table string, opts RowsOptions) (*Result, error)
func (*Client) TablesStats ¶ added in v0.14.0
type ConnContext ¶ added in v0.14.0
func (ConnContext) String ¶ added in v0.14.0
func (c ConnContext) String() string
type Dump ¶ added in v0.9.9
type Dump struct {
Table string
}
Dump represents a database dump
type Pagination ¶ added in v0.8.0
type Result ¶
type Result struct {
Pagination *Pagination `json:"pagination,omitempty"`
Columns []string `json:"columns"`
Rows []Row `json:"rows"`
Stats *ResultStats `json:"stats,omitempty"`
}
func (*Result) PostProcess ¶ added in v0.11.10
func (res *Result) PostProcess()
Due to big int number limitations in javascript, numbers should be encoded as strings so they could be properly loaded on the frontend.
type ResultStats ¶ added in v0.13.0
type RowsOptions ¶
type RowsOptions struct {
Where string // Custom filter
Offset int // Number of rows to skip
Limit int // Number of rows to fetch
SortColumn string // Column to sort by
SortOrder string // Sort direction (ASC, DESC)
}
RowsOptions contains a list of parameters for table browsing requests
type Tunnel ¶ added in v0.9.0
type Tunnel struct {
TargetHost string
TargetPort string
Port int
SSHInfo *shared.SSHInfo
Config *ssh.ClientConfig
Client *ssh.Client
Listener *net.TCPListener
}
Tunnel represents the connection between local and remote server
func (*Tunnel) Close ¶ added in v0.9.0
func (tunnel *Tunnel) Close()
Close closes the tunnel connection
Click to show internal directories.
Click to hide internal directories.