client

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 14 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) ActiveDatabase added in v0.29.0

func (c *Client) ActiveDatabase() string

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) 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) SetActiveDatabase added in v0.29.0

func (c *Client) SetActiveDatabase(database string)

func (*Client) ShowDataCatalog added in v0.29.0

func (c *Client) ShowDataCatalog() bool

func (*Client) ShowDatabases added in v0.29.0

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

ShowDatabases returns a list of the databases the user has access to.

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) ShowTablesPerDB added in v0.29.0

func (c *Client) ShowTablesPerDB(database string) ([]string, error)

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
JackTT - Gopher 🇻🇳