Documentation
¶
Index ¶
- Variables
- func Eval(ctx context.Context, doc *enigma.Doc, args []string)
- func LogVerbose(message string)
- func PrintField(ctx context.Context, doc *enigma.Doc, fieldName string)
- func RelativeToProject(projectFile string, path string) string
- func Reload(ctx context.Context, doc *enigma.Doc, global *enigma.Global, ...)
- func Save(ctx context.Context, doc *enigma.Doc, path string)
- func SetScript(ctx context.Context, doc *enigma.Doc, scriptFilePath string)
- func SetupConnections(ctx context.Context, doc *enigma.Doc, projectFilePath string, ...) error
- type ConnectionConfigEntry
- type ConnectionsConfigFile
- type FieldMetadata
- type FieldSourceTableInfo
- type Metadata
- type ModelMetadata
- type State
- type TableMetadata
Constants ¶
This section is empty.
Variables ¶
var QliVerbose bool
QliVerbose is set to true to indicate that verbose logging should be enabled.
Functions ¶
func Eval ¶
Eval builds a straight table hypercube based on the supplied argument, evaluates it and prints the result to system out.
func LogVerbose ¶
func LogVerbose(message string)
LogVerbose prints the supplied message to system out if verbose logging is enabled.
func PrintField ¶
PrintField prints the first few rows of a field to system out.
func RelativeToProject ¶
RelativeToProject transforms a path to be relative to a base path of the project file
func Reload ¶
Reload reloads the app and prints the progress to system out. If true is supplied to skipTransientLogs the live ticking of table row counts is disabled (useful for testing).
func Save ¶
Save calls DoSave on the app and prints "Done" if it succeeded or "Save failed" to system out.
Types ¶
type ConnectionConfigEntry ¶
type ConnectionConfigEntry struct {
Type string
Username string
Password string
Path string
Settings map[string]string
}
ConnectionConfigEntry defines the content of a connection in either the project config yml file or a connections yml file.
type ConnectionsConfigFile ¶
type ConnectionsConfigFile struct {
Connections map[string]ConnectionConfigEntry
}
ConnectionsConfigFile defines the content of a connections yml file.
func ReadConnectionsFile ¶
func ReadConnectionsFile(path string) ConnectionsConfigFile
ReadConnectionsFile reads the connections config file from the supplied path.
type FieldMetadata ¶
type FieldMetadata struct {
// Name of the field.
Name string `json:"name"`
// No List of table names.
SrcTables []string `json:"src_tables"`
// If set to true, it means that the field is a system field. The default value is false.
IsSystem bool `json:"is_system"`
// If set to true, it means that the field is hidden. The default value is false.
IsHidden bool `json:"is_hidden"`
// If set to true, it means that the field is a semantic. The default value is false.
IsSemantic bool `json:"is_semantic"`
// If set to true, only distinct field values are shown. The default value is false.
DistinctOnly bool `json:"distinct_only"`
// Number of distinct field values.
Cardinal int `json:"cardinal"`
// Total number of field values.
TotalCount int `json:"total_count"`
// If set to true, it means that the field is locked. The default value is false.
IsLocked bool `json:"is_locked"`
// If set to true, it means that the field has one and only one selection (not 0 and not more than 1). If this property is set to true, the field cannot be cleared anymore and no more selections can be performed in that field. The default value is false.
AlwaysOneSelected bool `json:"always_one_selected"`
// Is set to true if the value is a numeric. The default value is false.
IsNumeric bool `json:"is_numeric"`
// Field comment.
Comment string `json:"comment"`
// No Gives information on a field. For example, it can return the type of the field. Examples: key, text, ASCII.
Tags []string `json:"tags"`
// Static RAM memory used in bytes.
ByteSize int `json:"byte_size"`
}
FieldMetadata defines all available info about a a field
type FieldSourceTableInfo ¶
FieldSourceTableInfo defines row count and key type for a field
type Metadata ¶
type Metadata struct {
StaticByteSize int `json:"static_byte_size,omitempty"`
Fields []*FieldMetadata `json:"fields"`
Tables []*TableMetadata `json:"tables"`
}
Metadata defines all available info from the metdata rest api.
func ReadMetadata ¶
ReadMetadata fetches metadata from the rest api.
type ModelMetadata ¶
type ModelMetadata struct {
Tables []*enigma.TableRecord
SourceKeys []*enigma.SourceKeyRecord
Metadata *Metadata
TableMetadataByName map[string]*TableMetadata
FieldMetadataByName map[string]*FieldMetadata
SystemTableLayout *enigma.GenericObjectLayout
FieldsInTable map[string]string
FieldNames []string
TableNames []string
FieldSourceTableInfoByName map[string][]FieldSourceTableInfo
FieldInTableDataByNames map[string]map[string]*enigma.FieldInTableData
SampleContentByFieldName map[string]string
}
ModelMetadata defines all available metadata around the data model.
func GetModelMetadata ¶
func GetModelMetadata(ctx context.Context, doc *enigma.Doc, metaURL string, keyOnly bool) *ModelMetadata
GetModelMetadata retrives all available metadata about the app
type State ¶
type State struct {
Doc *enigma.Doc
Ctx context.Context
Global *enigma.Global
AppID string
MetaURL string
Verbose bool
}
State contains all needed info about the current app including a go context to use when communicating with the engine.
func PrepareEngineState ¶
func PrepareEngineState(ctx context.Context, engine string, sessionID string, appID string, ttl string) *State
PrepareEngineState makes sure that the app idenfied by the supplied parameters is created or opened or reconnected to depending on the state. The TTL feature is used to keep the app session loaded to improve performance.
type TableMetadata ¶
type TableMetadata struct {
// Name of the table.
Name string `json:"name"`
// If set to true, it means that the table is a system table. The default value is false.
IsSystem bool `json:"is_system"`
// If set to true, it means that the table is a semantic. The default value is false.
IsSemantic bool `json:"is_semantic"`
// If set to true, it means that the table is loose due to circular connection. The default value is false.
IsLoose bool `json:"is_loose"`
// of rows.
NoOfRows int `json:"no_of_rows"`
// of fields.
NoOfFields int `json:"no_of_fields"`
// of key fields.
NoOfKeyFields int `json:"no_of_key_fields"`
// Table comment.
Comment string `json:"commen"`
// RAM memory used in bytes.
ByteSize int `json:"byte_size"`
}
TableMetadata defines all available info about a table.