client

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 10 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
}

Client is used to store the pool of db connection.

func New

func New(opts command.Options) (*Client, error)

New return an instance of the client.

func (*Client) DB

func (c *Client) DB() *sqlx.DB

DB Return the db attribute.

func (*Client) Driver

func (c *Client) Driver() string

Driver returns the driver of the database.

func (*Client) Metadata added in v0.15.0

func (c *Client) Metadata(tableName string) (*Metadata, error)

Metadata returns the most relevant data from a given table.

func (*Client) NextPage added in v0.15.0

func (c *Client) NextPage() (*Table, int, error)

NextPage returns the next page of the given table, based off the limit and the offsite.

func (*Client) PreviousPage added in v0.15.0

func (c *Client) PreviousPage() (*Table, int, error)

PreviousPage returns the next page of the given table, based off the limit and the offsite.

func (*Client) Query added in v0.2.0

func (c *Client) Query(q string, args ...interface{}) ([][]string, []string, error)

Query returns performs the query and returns the result set and the column names.

func (*Client) ResetPagination added in v0.15.0

func (c *Client) ResetPagination() error

ResetPagination resets the paginationManager field.

func (*Client) ShowTables added in v0.3.0

func (c *Client) ShowTables() ([]string, error)

ShowTables list all the tables in the database on the tables panel.

func (*Client) TotalPages added in v0.16.2

func (c *Client) TotalPages() int

type Metadata added in v0.15.0

type Metadata struct {
	TableContent Table
	Structure    Table
	Constraints  Table
	Indexes      Table
	TotalPages   int
}

Metadata sums up the most relevant data from a table.

type Table added in v0.15.0

type Table struct {
	Rows    [][]string
	Columns []string
	// contains filtered or unexported fields
}

Table represents a SQL table.

func (*Table) Name added in v0.16.2

func (t *Table) Name() string

Jump to

Keyboard shortcuts

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