postgres

package
v1.9.10 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectTimeout = errors.New(`连接超时,请重试`)

Functions

func EncodeDSN

func EncodeDSN(dsn string) string

EncodeDSN encodes the DSN for URL safe transport

func LookupPgDump

func LookupPgDump() (string, error)

LookupPgDump finds pg_dump binary.

func LookupPsql

func LookupPsql() (string, error)

LookupPsql finds psql binary.

func NativeExportPG

func NativeExportPG(ctx context.Context, cfg *shared.DBConfig, tables []string, structWriter, dataWriter io.Writer) error

NativeExportPG uses pg_dump to export tables.

func NativeImportPG

func NativeImportPG(ctx context.Context, cfg *shared.DBConfig, files []string, noticer *notice.NoticeAndProgress) error

NativeImportPG uses psql to import SQL files.

func New

func New() driver.Driver

func QuoteCol

func QuoteCol(name string) string

QuoteCol quotes a column/identifier name for PostgreSQL

func QuoteVal

func QuoteVal(v string) string

QuoteVal quotes a value string for PostgreSQL

func SupportedCmdExport

func SupportedCmdExport() bool

SupportedExport returns true if the native export tool for the given driver is available.

func SupportedCmdImport

func SupportedCmdImport() bool

SupportedImport returns true if the native import tool for the given driver is available.

Types

type FieldInfo

type FieldInfo struct {
	ColumnName    string
	DataType      string
	IsNullable    string
	ColumnDefault string
	CharacterMax  int64
	Comment       string
}

FieldInfo holds column information

type Postgres

type Postgres struct {
	*driver.BaseDriver
	// contains filtered or unexported fields
}

func (*Postgres) CreateData

func (p *Postgres) CreateData() error

CreateData handles insert, update, and delete of table data

func (*Postgres) CreateDb

func (p *Postgres) CreateDb() error

CreateDb handles the create database operation

func (*Postgres) CreateTable

func (p *Postgres) CreateTable() error

CreateTable handles the create table operation

func (*Postgres) Export

func (p *Postgres) Export() error

func (*Postgres) Import

func (p *Postgres) Import() error

func (*Postgres) Indexes

func (p *Postgres) Indexes() error

Indexes handles showing indexes for a table

func (*Postgres) Info

func (p *Postgres) Info() error

Info handles the server info operation

func (*Postgres) Init

func (p *Postgres) Init(ctx echo.Context, auth *driver.DbAuth)

func (*Postgres) IsSupported

func (p *Postgres) IsSupported(operation string) bool

func (*Postgres) ListData

func (p *Postgres) ListData() error

ListData handles displaying table data (paginated)

func (*Postgres) ListDb

func (p *Postgres) ListDb() error

ListDb handles the list databases operation

func (*Postgres) ListTable

func (p *Postgres) ListTable() error

ListTable handles the list tables operation

func (*Postgres) Login

func (p *Postgres) Login() error

func (*Postgres) Logined

func (p *Postgres) Logined() bool

func (*Postgres) Logout

func (p *Postgres) Logout() error

func (*Postgres) ModifyDb

func (p *Postgres) ModifyDb() error

ModifyDb handles the modify/delete database operation

func (*Postgres) ModifyTable

func (p *Postgres) ModifyTable() error

ModifyTable handles the modify table operation

func (*Postgres) Name

func (p *Postgres) Name() string

func (*Postgres) Privileges

func (p *Postgres) Privileges() error

Privileges handles the privileges management operation

func (*Postgres) ProcessList

func (p *Postgres) ProcessList() error

ProcessList handles showing the process list

func (*Postgres) RunCommand

func (p *Postgres) RunCommand() error

RunCommand handles running SQL commands

func (*Postgres) ViewTable

func (p *Postgres) ViewTable() error

ViewTable handles the view table structure operation

type TableStatus

type TableStatus struct {
	Name       string
	Schema     string
	Owner      string
	Rows       int64
	Size       string
	SizePretty string
	Comment    string
}

TableStatus holds table status information for PostgreSQL

Jump to

Keyboard shortcuts

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