postgres

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReturnsRows

func ReturnsRows(statement string) bool

func Target

func Target(values driver.FormValues) string

Target builds the PostgreSQL connection URL for the connection form's server fields. TLS is the mode ("verify-full", "require", "disable"); blank falls back to the disabled mode.

Types

type Factory added in v0.11.0

type Factory struct{}

func (Factory) BuildTarget added in v0.11.0

func (Factory) Capabilities added in v0.11.0

func (Factory) Capabilities() driver.Capabilities

func (Factory) Open added in v0.11.0

func (Factory) Open(ctx context.Context, target string) (driver.OpenResult, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, dsn string) (*Service, error)

func (*Service) AddColumn

func (s *Service) AddColumn(ctx context.Context, table string, col driver.ColumnDef) error

func (*Service) AlterColumn

func (s *Service) AlterColumn(ctx context.Context, table string, change driver.ColumnChange) error

func (*Service) BrowseTable

func (s *Service) BrowseTable(ctx context.Context, name string, options driver.BrowseOptions) (driver.Result, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) CreateForeignKey

func (s *Service) CreateForeignKey(ctx context.Context, table string, change driver.ForeignKeyChange) error

func (*Service) CreateIndex

func (s *Service) CreateIndex(ctx context.Context, table string, change driver.IndexChange) error

func (*Service) DeleteRow

func (s *Service) DeleteRow(ctx context.Context, table string, key []driver.RowValue) (driver.Result, error)

DeleteRow removes the row identified by key. NULL key values become IS NULL predicates so NULL primary-key parts still match.

func (*Service) DropColumn

func (s *Service) DropColumn(ctx context.Context, table, name string) error

func (*Service) DropForeignKey

func (s *Service) DropForeignKey(ctx context.Context, table, previous string) error

func (*Service) DropIndex

func (s *Service) DropIndex(ctx context.Context, table, name string) error

func (*Service) Execute

func (s *Service) Execute(ctx context.Context, statement string) (result driver.Result, err error)

func (*Service) ExecuteReadOnly

func (s *Service) ExecuteReadOnly(ctx context.Context, statement string) (result driver.Result, err error)

func (*Service) Info

func (s *Service) Info() driver.DatabaseInfo

func (*Service) InsertRow

func (s *Service) InsertRow(ctx context.Context, table string, values []driver.RowValue) (driver.Result, error)

InsertRow inserts one row, binding values as parameters instead of quoting them by hand. ValueDefault columns are omitted so engine defaults and auto-increment apply; a row of pure defaults uses DEFAULT VALUES. Placeholders are monotonically numbered $1..$N.

func (*Service) ListForeignKeys

func (s *Service) ListForeignKeys(ctx context.Context, table string) ([]driver.ForeignKeyInfo, error)

func (*Service) ListForeignKeysAll

func (s *Service) ListForeignKeysAll(ctx context.Context) (map[string][]driver.ForeignKeyInfo, error)

ListForeignKeysAll returns every foreign key in the connected database, keyed by the declaring table's qualified name (schema.table).

func (*Service) ListIndexes

func (s *Service) ListIndexes(ctx context.Context, table string) ([]driver.IndexInfo, error)

func (*Service) ListIndexesAll

func (s *Service) ListIndexesAll(ctx context.Context) (map[string][]driver.IndexInfo, error)

ListIndexesAll returns every index in the connected database, keyed by the indexed table's qualified name (schema.table).

func (*Service) ListReferencingForeignKeys

func (s *Service) ListReferencingForeignKeys(ctx context.Context, table string) ([]driver.ReferencingForeignKeyInfo, error)

func (*Service) ListSchema

func (s *Service) ListSchema(ctx context.Context) ([]driver.SchemaObject, error)

ListSchema reports every connectable database as a root, followed by the connected database's schemas and tables. PostgreSQL can only address objects in the current database, so only its children are listed; the other roots exist so the sidebar mirrors MySQL (where created databases appear immediately) without pretending to browse into them. Roots sort alphabetically, not connected-first: reconnecting to another database must not reshuffle the sidebar under the selection.

func (*Service) ReplaceForeignKey

func (s *Service) ReplaceForeignKey(ctx context.Context, table, previous string, change driver.ForeignKeyChange) error

func (*Service) ReplaceIndex

func (s *Service) ReplaceIndex(ctx context.Context, table, previous string, change driver.IndexChange) error

func (*Service) TableInfo

func (s *Service) TableInfo(ctx context.Context, name string) ([]driver.ColumnInfo, error)

func (*Service) UpdateRow

func (s *Service) UpdateRow(ctx context.Context, table string, key []driver.RowValue, values []driver.RowValue) (driver.Result, error)

UpdateRow sets the given columns on the row identified by key. A ValueDefault update value is rejected: DEFAULT is an insert-only state.

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, statement string) error

Validate prepares the statement against the open database without executing it, so syntax and schema errors surface without any side effects.

func (*Service) WriteCapabilities

func (s *Service) WriteCapabilities() driver.WriteCapabilities

WriteCapabilities reports the SQL row-write capability; the postgres driver has no document store.

Jump to

Keyboard shortcuts

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