client

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	History          []history.Record `json:"history"`
	ConnectionString string           `json:"connection_string"`
	// contains filtered or unexported fields
}

func New

func New() (*Client, error)

func NewFromUrl

func NewFromUrl(url string) (*Client, error)

func (*Client) Activity

func (client *Client) Activity() (*Result, error)

Returns all active queriers on the server

func (*Client) Close

func (client *Client) Close() error

Close database connection

func (*Client) Databases

func (client *Client) Databases() ([]string, error)

func (*Client) Info

func (client *Client) Info() (*Result, error)

func (*Client) Query

func (client *Client) Query(query string) (*Result, error)

func (*Client) Schemas

func (client *Client) Schemas() ([]string, error)

func (*Client) Sequences added in v0.7.0

func (client *Client) Sequences() ([]string, error)

func (*Client) Table

func (client *Client) Table(table string) (*Result, error)

func (*Client) TableConstraints added in v0.7.0

func (client *Client) TableConstraints(table string) (*Result, error)

func (*Client) TableIndexes

func (client *Client) TableIndexes(table string) (*Result, error)

func (*Client) TableInfo

func (client *Client) TableInfo(table string) (*Result, error)

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) Tables

func (client *Client) Tables() ([]string, error)

func (*Client) Test

func (client *Client) Test() error

type Pagination added in v0.8.0

type Pagination struct {
	Rows    int64 `json:"rows_count"`
	Page    int64 `json:"page"`
	Pages   int64 `json:"pages_count"`
	PerPage int64 `json:"per_page"`
}

type Result

type Result struct {
	Pagination *Pagination `json:"pagination,omitempty"`
	Columns    []string    `json:"columns"`
	Rows       []Row       `json:"rows"`
}

func (*Result) CSV

func (res *Result) CSV() []byte

func (*Result) Format

func (res *Result) Format() []map[string]interface{}

func (*Result) JSON added in v0.7.0

func (res *Result) JSON() []byte

func (*Result) PrepareBigints added in v0.8.0

func (res *Result) PrepareBigints()

Due to big int number limitations in javascript, numbers should be encoded as strings so they could be properly loaded on the frontend.

type Row

type Row []interface{}

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)
}

Struct to hold table rows browsing options

Jump to

Keyboard shortcuts

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