postgresql

package
v1.9.1-0...-8664551 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIELD_CONTEXT = "context"
	FIELD_QUERY   = "query"
)

Variables

This section is empty.

Functions

func RetrieveToMap

func RetrieveToMap(rows pgx.Rows) ([]map[string]interface{}, error)

Types

type Connector

type Connector struct {
	Resource Options
	Action   Query
}

func (*Connector) GetMetaInfo

func (p *Connector) GetMetaInfo(resourceOptions map[string]interface{}) (common.MetaInfoResult, error)

func (*Connector) Run

func (p *Connector) Run(resourceOptions map[string]interface{}, actionOptions map[string]interface{}, rawActionOptions map[string]interface{}) (common.RuntimeResult, error)

func (*Connector) TestConnection

func (p *Connector) TestConnection(resourceOptions map[string]interface{}) (common.ConnectionResult, error)

func (*Connector) ValidateActionTemplate

func (p *Connector) ValidateActionTemplate(actionOptions map[string]interface{}) (common.ValidateResult, error)

func (*Connector) ValidateResourceOptions

func (p *Connector) ValidateResourceOptions(resourceOptions map[string]interface{}) (common.ValidateResult, error)

type Options

type Options struct {
	Host             string `validate:"required"`
	Port             string `validate:"required"`
	DatabaseName     string `validate:"required"`
	DatabaseUsername string `validate:"required"`
	DatabasePassword string `validate:"required"`
	SSL              SSLOptions
}

type Query

type Query struct {
	Mode     string `validate:"required,oneof=gui sql sql-safe"`
	Query    string
	RawQuery string
	Context  map[string]interface{}
}

func (*Query) IsSafeMode

func (q *Query) IsSafeMode() bool

func (*Query) SetRawQueryAndContext

func (q *Query) SetRawQueryAndContext(rawTemplate map[string]interface{}) error

type SSLOptions

type SSLOptions struct {
	SSL        bool
	ServerCert string `validate:"required_unless=SSL false"`
	ClientKey  string
	ClientCert string
}

Jump to

Keyboard shortcuts

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