Documentation
¶
Index ¶
- Variables
- func EncodeDSN(dsn string) string
- func LookupPgDump() (string, error)
- func LookupPsql() (string, error)
- func NativeExportPG(ctx context.Context, cfg *shared.DBConfig, tables []string, ...) error
- func NativeImportPG(ctx context.Context, cfg *shared.DBConfig, files []string, ...) error
- func New() driver.Driver
- func QuoteCol(name string) string
- func QuoteVal(v string) string
- func SupportedCmdExport() bool
- func SupportedCmdImport() bool
- type FieldInfo
- type Postgres
- func (p *Postgres) CreateData() error
- func (p *Postgres) CreateDb() error
- func (p *Postgres) CreateTable() error
- func (p *Postgres) Export() error
- func (p *Postgres) Import() error
- func (p *Postgres) Indexes() error
- func (p *Postgres) Info() error
- func (p *Postgres) Init(ctx echo.Context, auth *driver.DbAuth)
- func (p *Postgres) IsSupported(operation string) bool
- func (p *Postgres) ListData() error
- func (p *Postgres) ListDb() error
- func (p *Postgres) ListTable() error
- func (p *Postgres) Login() error
- func (p *Postgres) Logined() bool
- func (p *Postgres) Logout() error
- func (p *Postgres) ModifyDb() error
- func (p *Postgres) ModifyTable() error
- func (p *Postgres) Name() string
- func (p *Postgres) Privileges() error
- func (p *Postgres) ProcessList() error
- func (p *Postgres) RunCommand() error
- func (p *Postgres) ViewTable() error
- type TableStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConnectTimeout = errors.New(`连接超时,请重试`)
Functions ¶
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 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 ¶
CreateData handles insert, update, and delete of table data
func (*Postgres) CreateTable ¶
CreateTable handles the create table operation
func (*Postgres) IsSupported ¶
func (*Postgres) ModifyTable ¶
ModifyTable handles the modify table operation
func (*Postgres) Privileges ¶
Privileges handles the privileges management operation
func (*Postgres) ProcessList ¶
ProcessList handles showing the process list
func (*Postgres) RunCommand ¶
RunCommand handles running SQL commands
Click to show internal directories.
Click to hide internal directories.