postgres

package
v0.0.0-...-abf6529 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: LGPL-2.1 Imports: 4 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 {
	// contains filtered or unexported fields
}

func New

func New(db *sqlx.DB) *Client

func (*Client) DescribeTable

func (c *Client) DescribeTable(ctx context.Context, table string) ([]Column, error)

func (*Client) MaterializedViews

func (c *Client) MaterializedViews(ctx context.Context) ([]View, error)

func (*Client) Schemas

func (c *Client) Schemas(ctx context.Context) ([]Schema, error)

func (*Client) SchemasUserCreated

func (c *Client) SchemasUserCreated(ctx context.Context) ([]Schema, error)

func (*Client) Tables

func (c *Client) Tables(ctx context.Context) ([]PGTable, error)

func (*Client) TablesBySize

func (c *Client) TablesBySize(ctx context.Context) ([]PGTable, error)

func (*Client) TablesBySizeWithIndex

func (c *Client) TablesBySizeWithIndex(ctx context.Context) ([]PGTable, error)

func (*Client) Views

func (c *Client) Views(ctx context.Context) ([]View, error)

type Column

type Column struct {
	Catalog  string `db:"table_catalog"`
	Schema   string `db:"table_schema"`
	Name     string `db:"table_name"`
	Column   string `db:"column_name"`
	Nullable string `db:"is_nullable"`
	Type     string `db:"data_type"`
}

type PGTable

type PGTable struct {
	Catalog     string `db:"table_catalog"`
	Name        string `db:"table_name"`
	Owner       string `db:"table_type"`
	Schema      string `db:"table_schema"`
	TableSize   int    `db:"table_size"`
	IndexesSize int    `db:"indexes_size"`
	TotalSize   int    `db:"total_size"`
}

type Schema

type Schema struct {
	Name        string `db:"schema_name"`
	Owner       string `db:"schema_owner"`
	CatalogName string `db:"catalog_name"`
	TableCount  int    `db:"table_count"`
}

type View

type View struct {
	Name                  string `db:"view_name"`
	Definition            string `db:"definition"`
	IsPopulated           bool   `db:"ispopulated"`
	Owner                 string `db:"owner"`
	ViewSchema            string `db:"schema_name"`
	ReferencedTableSchema string `db:"referenced_table_schema"`
	ReferencedTableName   string `db:"referenced_table_name"`
}

Jump to

Keyboard shortcuts

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