Documentation ¶
Index ¶
- Constants
- func EvaluateQuery(query string, inputData Input) (string, []interface{}, []string, error)
- func New(actionerr ActionError) error
- func NewDB(settings map[string]interface{}) (*sql.DB, error)
- func QueryBasicCheck(s string) error
- type ActionError
- type Connection
- type Connector
- type DBDiagnostic
- type Input
- type PgFactory
- type PgSharedConfigManager
- func (p *PgSharedConfigManager) PreparedDelete(queryString string, inputData *Input, logCache log.Logger) (results map[string]interface{}, err error)
- func (p *PgSharedConfigManager) PreparedInsert(queryString string, inputData *Input, fields interface{}, logCache log.Logger) (results *ResultSet, err error)
- func (p *PgSharedConfigManager) PreparedQuery(queryString string, inputData *Input, logCache log.Logger) (results *ResultSet, err error)
- func (p *PgSharedConfigManager) PreparedUpdate(queryString string, inputData *Input, fields interface{}, logCache log.Logger) (results *ResultSet, err error)
- type Query
- type QueryActivity
- type Recd
- type ResultSet
- type StatefulDB
- type StepStore
- func (s *StepStore) Delete(flowId string)
- func (s *StepStore) GetFailedFlows(metadata *metadata.Metadata) ([]*state.FlowInfo, error)
- func (s *StepStore) GetFlow(flowid string, metadata *metadata.Metadata) (*state.FlowInfo, error)
- func (s *StepStore) GetFlows(metadata *metadata.Metadata) ([]*state.FlowInfo, error)
- func (s *StepStore) GetSnapshot(flowId string) *state.Snapshot
- func (s *StepStore) GetStatus(flowId string) int
- func (s *StepStore) GetSteps(flowId string) ([]*state.Step, error)
- func (s *StepStore) GetStepsNoData(flowId string) ([]map[string]string, error)
- func (s *StepStore) RecordEnd(flowState *state.FlowState) error
- func (s *StepStore) RecordStart(flowState *state.FlowState) error
- func (s *StepStore) SaveSnapshot(snapshot *state.Snapshot) error
- func (s *StepStore) SaveStep(step *state.Step) error
Constants ¶
const ( STEP_INSERT = "INSERT INTO steps (flowinstanceid, stepid, taskname, status, starttime, endtime, stepdata) VALUES ($1,$2,$3,$4,$5,$6,$7);" SNAPSHOT_INSERT = "INSERT INTO snapshopt (flowinstanceid, hostid, stepid, starttime, endtime, stepdata) VALUES ($1,$2,$3,$4,$5,$6);" FlowState_INSERT = "" /* 130-byte string literal not displayed */ UpdateFlowState = "UPDATE flowstate set endtime=$1,status=$2 where flowinstanceid = $3;" UpsertSteps = "" /* 281-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func EvaluateQuery ¶
EvaluateQuery ... consider query:insert into users(?name, ?id) values(?name, ?id), inputData.values=[('john', 'id')]
Types ¶
type ActionError ¶
type ActionError struct { APIName string `json:"APIName"` Diag []DBDiagnostic `json:"Diag,omitempty"` }
ActionError ..
func (*ActionError) Error ¶
func (acterr *ActionError) Error() string
type Connection ¶
type Connection struct { DatabaseURL string `json:"databaseURL"` Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` DbName string `json:"databaseName"` SSLMode string `json:"sslmode"` // contains filtered or unexported fields }
Connection datastructure for storing PostgreSQL connection details
func (*Connection) Login ¶
func (con *Connection) Login() (err error)
Login connects to the the postgres database cluster using the connection details provided in Connection configuration
func (*Connection) Logout ¶
func (con *Connection) Logout() (err error)
Logout the database connection
type Connector ¶
type Connector struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Title string `json:"title"` Version string `json:"version"` Type string `json:"type"` Ref string `json:"ref"` Settings []struct { Name string `json:"name"` Type string `json:"type"` Value interface{} `json:"value"` } `json:"settings"` }
Connector is a representation of connector.json metadata for the postgres connection
type DBDiagnostic ¶
type DBDiagnostic struct { State string `json:"State"` NativeError string `json:"NativeError"` Messge string `json:"Message"` }
DBDiagnostic ..
type Input ¶
type Input struct { Parameters map[string]interface{} `json:"parameters,omitempty"` Values []map[string]interface{} `json:"values,omitempty"` }
Input is a representation of acitivity's input parametres
type PgSharedConfigManager ¶
type PgSharedConfigManager struct {
// contains filtered or unexported fields
}
func (*PgSharedConfigManager) PreparedDelete ¶
func (p *PgSharedConfigManager) PreparedDelete(queryString string, inputData *Input, logCache log.Logger) (results map[string]interface{}, err error)
PreparedDelete allows to delete records
func (*PgSharedConfigManager) PreparedInsert ¶
func (p *PgSharedConfigManager) PreparedInsert(queryString string, inputData *Input, fields interface{}, logCache log.Logger) (results *ResultSet, err error)
PreparedInsert allows querying database with named parameters
func (*PgSharedConfigManager) PreparedQuery ¶
func (p *PgSharedConfigManager) PreparedQuery(queryString string, inputData *Input, logCache log.Logger) (results *ResultSet, err error)
PreparedQuery allows querying database with named parameters
func (*PgSharedConfigManager) PreparedUpdate ¶
func (p *PgSharedConfigManager) PreparedUpdate(queryString string, inputData *Input, fields interface{}, logCache log.Logger) (results *ResultSet, err error)
PreparedUpdate allows updating database with named parameters
type Query ¶
type Query struct { TableName string `json:"tableName"` Cols []string `json:"columns"` Filters map[string]string `json:"filters"` }
Query structure for SQL Queries
type QueryActivity ¶
type QueryActivity struct {
// contains filtered or unexported fields
}
QueryActivity provides Activity metadata for Flogo
type Recd ¶
type Recd map[string]interface{}
record is the one row of the ResultSet retrieved from database after execution of SQL Query
type ResultSet ¶
type ResultSet struct {
Record []*Recd `json:"records"`
}
ResultSet is an aggregation of SQL Query data records fetched from the database
type StatefulDB ¶
type StatefulDB struct {
// contains filtered or unexported fields
}
func (*StatefulDB) InsertFlowState ¶
func (s *StatefulDB) InsertFlowState(flowState *state.FlowState) (results *ResultSet, err error)
func (*StatefulDB) InsertSteps ¶
func (s *StatefulDB) InsertSteps(step *state.Step) (results *ResultSet, err error)
func (*StatefulDB) UpdateFlowState ¶
func (s *StatefulDB) UpdateFlowState(flowState *state.FlowState) (results *ResultSet, err error)