Skip to content

skyarcd ​

原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793488811/FIN+5.3.1+skyarcd 中文整理基于 FIN 5.3.1

导读: SkySpark 框架守护进程 API

以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。


目录(导读) ​

  • mixins
  • classes
  • enums
  • facets
  • Slot Details
    • actionTypeName
    • aws
    • dis
    • envType
    • extName
    • fromStr
    • isAws
    • isLocal
    • isTest
    • local
    • sysModTypeName
    • test
    • useLocalhostAddr
    • vals
    • actionNormInput
    • add
    • make
    • remove
    • toResult
    • trash
    • update
    • validate
    • asCur
    • checkAdmin
    • checkSu
    • cur
    • db
    • ext
    • exts
    • feedKey
    • filterPather
    • ns
    • proj
    • read
    • readAll
    • readById
    • rt
    • session
    • sys
    • user
    • hx
    • settings
    • depends
    • icon
    • name
    • toStr
    • meta
    • vars
    • type
    • err
    • errOn
    • rec
    • tag
    • val
    • warn
    • warnOn
    • lint
    • create
    • appendBin
    • backup
    • backups
    • commit
    • commitAll
    • dir
    • emptyTrash
    • extActorPool
    • extAdd
    • extRemove
    • id
    • isSteadyState
    • passwords
    • pim
    • readAllList
    • readBin
    • readByIds
    • readByIdsList
    • readCount
    • watch
    • watchOpen
    • watches
    • writeBin
    • delete
    • in
    • size
    • ts
    • addExt
    • addRec
    • eval
    • setup
    • teardown
    • placeholder
    • restart
    • homeDir
    • host
    • log
    • mod
    • mods
    • varDir
    • version
    • authenticate
    • users
    • define
    • execute
    • findAll
    • flatMap
    • hisRead
    • hisRollup
    • hisRollupAuto
    • makeContext
    • map
    • navProjs
    • pivot
    • projs
    • timeout
    • useReplicas
  • …(其余标题见英文正文)

API 正文(英文) ​

enums ​

CloudProviderTypeProvider enum

facets ​

DbTestAnnotates a ProjTest method to setup a test project
ExtMetaMeta-data facet which must be configured for each Ext type.
HxSysModMetaFacet to apply to a HxSysMod subclass which wraps an HxLib from haxall
SettingFacet to annotate a Settings field.

CloudProviderType ​

@Serializable { simple=true } enum class CloudProviderType : Enum

Provider enum

Enum

local
aws
test

Constructors

fromStrReturn the CloudProviderType instance for the specified name.

Fields

disDisplay name for the provider
envTypeCloudEnv qualified type name
extNameExtension which implements clouddd::ProviderExt or null
valsList of CloudProviderType values indexed by ordinal

Methods

actionTypeNameQualified class name for DeployActions
isAws
isLocal
isTest
sysModTypeNameQualified class name for a provider-specific SysMod
useLocalhostAddrUse 127.0.0.1 for all node addresses

Slot Details ​


actionTypeName ​

Str actionTypeName(Str baseType)

Qualified class name for DeployActions


aws ​

const static CloudProviderType aws := ...


dis ​

const Str dis

Display name for the provider


envType ​

const Str envType

CloudEnv qualified type name


extName ​

const Str? extName

Extension which implements clouddd::ProviderExt or null


fromStr ​

static new fromStr(Str name, Bool checked := true)

Return the CloudProviderType instance for the specified name. If not a valid name and checked is false return null, otherwise throw ParseErr.


isAws ​

Bool isAws()


isLocal ​

Bool isLocal()


isTest ​

Bool isTest()


local ​

const static CloudProviderType local := ...


sysModTypeName ​

Str sysModTypeName(Str baseName)

Qualified class name for a provider-specific SysMod


test ​

const static CloudProviderType test := ...


useLocalhostAddr ​

Bool useLocalhostAddr()

Use 127.0.0.1 for all node addresses


vals ​

const static CloudProviderType[] vals := ...

List of CloudProviderType values indexed by ordinal


Committer ​

class Committer : Obj

Commit result of a form view or form action to Folio

Constructors

makeConstruct with form object which can be Grid or Dict

Methods

actionNormInputNormalize an action argument passed to an Axon function.
addCommit by adding the form as a new record in the database
removeCommit by the removing the record(s) from the database
toResult
trashCommit by adding with the trash tag
updateCommit by updating the record(s) in the database
validateValidate against the given template

Slot Details ​


actionNormInput ​

static Obj actionNormInput(Obj arg, Str type)

Normalize an action argument passed to an Axon function. Actions should never assume a specific argument type, but instead should call this to convert to the desired type. The type should be one of the following string contants:

  • "id": return selection as Ref
  • "ids": return selection as Ref[]
  • "dict": return form data as Dict
  • "dicts": return form data as Dict[]
  • "ioHandle": return a Uri as an IOHandle
  • "ioHandles": return a Uri[] as IOHandle[]

Note that form "edits" only return changed values for dict input.

You may only obtain IO handles for files under the io/ directory.

Which conversions are available is based on the action itself. See Actions for more details.


add ​

Obj add()

Commit by adding the form as a new record in the database


make ​

new make(Obj arg)

Construct with form object which can be Grid or Dict


remove ​

Obj remove()

Commit by the removing the record(s) from the database


toResult ​

Obj? toResult()


trash ​

Obj trash()

Commit by adding with the trash tag


update ​

Obj update()

Commit by updating the record(s) in the database


validate ​

This validate(Str name)

Validate against the given template


Context ​

class Context : HxContext

Context manages the environment of Axon evaluations for a specific project and user

Constructors

makeMake context for system and optional project

Fields

sysSystem reference
userUser account and permissions associated with current context

Methods

asCurRun function using this Context as the current one.
checkAdminIf missing admin permission, throw PermissionErr
checkSuIf missing superuser permission, throw PermissionErr
curCurrent context for actor thread
dbProject database.
extConvenience for Proj.ext for current project.
extsConvenience for Proj.exts for current project.
feedKey
filterPatherDeprecated.
nsNamespace of definitions in effect for this context
projCurrent project associated with context
readRead a record by filter using cache.
readAllRead a set of record by filter using cache.
readByIdRead a record by id using cache.
rtProject Haxall runtime.
sessionAuthentication session associated with this context if applicable

Slot Details ​


asCur ​

Obj? asCur(|Context->Obj?| f)

Run function using this Context as the current one. This method automatically saves/restore the existing context.


checkAdmin ​

virtual override Void checkAdmin(Str action)

If missing admin permission, throw PermissionErr


checkSu ​

virtual override Void checkSu(Str action)

If missing superuser permission, throw PermissionErr


cur ​

static Context? cur(Bool checked := true)

Current context for actor thread


db ​

virtual override Folio db()

Project database. Raise exception if context not within a project.


ext ​

Ext? ext(Str name, Bool checked := true)

Convenience for Proj.ext for current project.


exts ​

Ext[] exts()

Convenience for Proj.exts for current project.


feedKey ​

Str feedKey()


filterPather ​

@Deprecated { msg="Use Filter.matches(rec, this)" } |Ref->Dict?| filterPather()

Deprecated. Now use Filter.matches with this as the context.


make ​

new make(Sys sys, User user, Proj? proj := null)

Make context for system and optional project


ns ​

virtual override SysNamespace ns()

Namespace of definitions in effect for this context


proj ​

Proj? proj(Bool checked := true)

Current project associated with context


read ​

Dict? read(Str filter, Bool checked := true)

Read a record by filter using cache.


readAll ​

Grid readAll(Str filter)

Read a set of record by filter using cache.


readById ​

Dict? readById(Ref id, Bool checked := true)

Read a record by id using cache.


rt ​

virtual override HxRuntime rt()

Project Haxall runtime.


session ​

virtual override Session? session(Bool checked := true)

Authentication session associated with this context if applicable


sys ​

const Sys sys

System reference


user ​

virtual const override User user

User account and permissions associated with current context


DbTest ​

@Serializable facet class DbTest : Obj, Facet

Annotates a ProjTest method to setup a test project

Slot Details ​


Ext ​

abstract const class Ext : HxLib

Ext is base class for extensions. To write an Ext:

  1. create concrete subclass of Ext
  2. annotate type with the ExtMeta facet
  3. create no arg make constructor (keep it lightweight)
  4. register with the "skyarc.ext" indexed prop
  5. define locale/en.props key "{name}.ext.dis"
  6. add ext to project using Proj.extAdd

If the Ext implements the Weblet mixin, then it handles any requests under ApiMod "{api}/{proj}/ext/{name}". The modeBase and modRel URIs are configured to the top of the extension's URI space.

Also see docSkySpark.

Constructors

makeAll subclasses must declare an arg make.

Methods

hxGet this ext as its native HxLib.
projProject this extension is running inside
settingsExt settings - see Exts
sysSystem reference

Slot Details ​


hx ​

virtual HxLib hx()

Get this ext as its native HxLib. For normal SkySpark extensions we always return this instance. But for native HxLibs this Ext wraps the actual instance as an Ext.


make ​

new make()

All subclasses must declare an arg make.


proj ​

Proj proj()

Project this extension is running inside


settings ​

virtual Settings settings()

Ext settings - see Exts


sys ​

Sys sys()

System reference


ExtMeta ​

@Serializable facet class ExtMeta : Obj, Facet

Meta-data facet which must be configured for each Ext type.

Also see docSkySpark.

Fields

dependsStr list of ext names this extension has a dependency on.
iconLogical icon name
nameProgramatic name of ext; must be a valid tag name and globally unique.

Methods

toStrString representation is name

Slot Details ​


depends ​

const Str[] depends := Str#.emptyList

Str list of ext names this extension has a dependency on.


icon ​

const Str icon := "puzzle"

Logical icon name


name ​

const Str name := ""

Programatic name of ext; must be a valid tag name and globally unique. Common pattern name of "FooExt" is "foo".


toStr ​

virtual override Str toStr()

String representation is name


HostMod ​

const class HostMod : SysMod

Host model and settings database

Fields

metaHost meta data tags

Methods

varsHost variables

Slot Details ​


meta ​

const Dict meta

Host meta data tags


vars ​

Dict vars()

Host variables


HxSysModMeta ​

@Serializable facet class HxSysModMeta : Obj, Facet

Facet to apply to a HxSysMod subclass which wraps an HxLib from haxall

Fields

typeType qname of the HxLib being wrapped

Slot Details ​


type ​

const Str type

Type qname of the HxLib being wrapped


LintContext ​

mixin LintContext

Subject record and tag for a Linter

Methods

errLog linter error for the current subject
errOnAdd error on tag which isn't the subject tag
nsDefinition namespace
projSubject project
recSubject record
sysSystem reference
tagSubject tag definition
valSubject tag value
warnLog linter warning for the current subject
warnOnAdd warning on tag which isn't the subject tag

Slot Details ​


err ​

abstract Void err(Str msg)

Log linter error for the current subject


errOn ​

abstract Void errOn(Str tag, Str msg)

Add error on tag which isn't the subject tag


ns ​

abstract SysNamespace ns()

Definition namespace


proj ​

abstract Proj? proj(Bool checked := true)

Subject project


rec ​

abstract Dict rec()

Subject record


sys ​

abstract Sys sys()

System reference


tag ​

abstract Def tag()

Subject tag definition


val ​

abstract Obj val()

Subject tag value


warn ​

abstract Void warn(Str msg)

Log linter warning for the current subject


warnOn ​

abstract Void warnOn(Str tag, Str msg)

Add warning on tag which isn't the subject tag


Linter ​

abstract const class Linter : Obj

Lint checker. To create a customer lint rule:

  1. Create subclass of Linter
  2. Ensure no arg constructor
  3. Override the lint method
  4. Register class name tag defs using linter tag

Example code:

// def
def: ^myTag
is: ^str
doc: "Str cannot be empty or contain spaces"
linter: "myPod::LintMyTag"

// Fantom class
const class LintMyTag : Linter
{
  override Void lint(LintContext cx)
  {
    str := cx.val as Str
    if (str == null) return // already flagged as wrong type
    if (str.isEmpty) cx.warn("String cannot be empty!")
    if (str.contains(" ")) cx.warn("String cannot contain spaces!")
  }
}

Methods

lintCheck the given subject rec and tag and report lint issues via LintContext.warn or LintContext.err.

Slot Details ​


lint ​

abstract Void lint(LintContext cx)

Check the given subject rec and tag and report lint issues via LintContext.warn or LintContext.err.


LogMod ​

const class LogMod : SysMod

Logging engine

Methods

createCreate or lookup a log identified by a set of tags which are either a Dict or Str:Obj.

Slot Details ​


create ​

Log create(Obj tags)

Create or lookup a log identified by a set of tags which are either a Dict or Str:Obj. The follow tags are standardized:

  • name: required string name for log
  • proj: project name if associated with a project
  • user: username string if associated with a user action
  • connRef: id of conn rec if associated specific connector

Proj ​

abstract const class Proj : Obj

Proj is the interface for working with a local in-VM project database.

Methods

appendBin
backupKick off a backup operation in the background.
backupsList the backups currently available for this Proj ordered by newest to oldest.
commitConvenience for commitAll to commit a single diff.
commitAllApply a list of diffs to the database in batch.
dirBase directory for project
disDisplay string for the project which is meta->dis or if not defined then the project name.
emptyTrashRemove all the records which are marked with the trash flag.
extFind an installed extension by its programtic name.
extActorPoolThe shared actor pool for extensions to use for their actors.
extAddAdd an extension to the project
extRemoveRemove an extension from the project using one of the following: Ref id, ExtDef, Str name, or Ext instance.
extsList the extensions which are enabled for this project.
idProject id which is always formatted as "p:{name}"
isSteadyStateHas the proj has reached steady state.
metaReturn projMeta record
nameProject name
nsProject specific definition namespace
passwordsGet storage for passwords and other secrets which is maintained separately from other data for security.
pimProject specific presentation information model
readFind the first record which matches the given filter string.
readAllMatch all the records against a filter string and return as grid.
readAllListMatch all the records against a filter string and return as list.
readBin
readByIdConvenience for readByIds
readByIdsRead a list of records by ids into a grid.
readByIdsListRead a list of records by id.
readCountReturn the number of records which match the given filter string.
rtHaxall runtime APIs
sysSystem reference
toStrReturn name
watchFind an open watch by its identifier.
watchOpenOpen a new watch with given display string for debugging.
watchesList the watches currently open for this project.
writeBin

Slot Details ​


appendBin ​

@Deprecated { msg="Use virtual file system" } Void appendBin(Dict rec, Str tag, Buf data)

Append the specified bytes to the end of the bin. If tag doesn't map to a Bin value, then throw UnknownNameErr. The bytes are written according to OutStream.writeBuf. Once this method is called the buf should not be modified. This method blocks until the data is successfully appended. Throw IOErr on failure.


backup ​

abstract Future backup()

Kick off a backup operation in the background.


backups ​

abstract ProjBackup[] backups()

List the backups currently available for this Proj ordered by newest to oldest. Also see backup.


commit ​

Diff commit(Diff diff)

Convenience for commitAll to commit a single diff.


commitAll ​

Diff[] commitAll(Diff[] diffs)

Apply a list of diffs to the database in batch. Either all the changes are successfully applied, or else none of them are applied and an exception is raised. Return updated Diffs which encapsulate both the old and new version of each record.

If any of the records have been modified since they were read for the given change set then ConcurrentChangeErr is thrown unless Diff.force configured.


dir ​

abstract File dir()

Base directory for project


dis ​

Str dis()

Display string for the project which is meta->dis or if not defined then the project name.


emptyTrash ​

Void emptyTrash()

Remove all the records which are marked with the trash flag.


ext ​

abstract Ext? ext(Str name, Bool checked := true)

Find an installed extension by its programtic name. If not found then throw Err or return null based on checked flag.


extActorPool ​

abstract ActorPool extActorPool()

The shared actor pool for extensions to use for their actors.


extAdd ​

abstract Ext extAdd(ExtDef def, Dict tags := Etc.emptyDict())

Add an extension to the project


extRemove ​

abstract Void extRemove(Obj ext)

Remove an extension from the project using one of the following: Ref id, ExtDef, Str name, or Ext instance.


exts ​

abstract Ext[] exts()

List the extensions which are enabled for this project.


id ​

abstract Ref id()

Project id which is always formatted as "p:{name}"


isSteadyState ​

abstract Bool isSteadyState()

Has the proj has reached steady state. Steady state is reached after a configurable wait period elapses after the project is fully loaded. This gives internal services time to spin up before interacting with external systems. The default is 1min, but may be tuned via the steadyState tag on projMeta. See Tuning.


meta ​

abstract Dict meta()

Return projMeta record


name ​

abstract Str name()

Project name


ns ​

abstract SysNamespace ns()

Project specific definition namespace


passwords ​

PasswordStore passwords()

Get storage for passwords and other secrets which is maintained separately from other data for security.


pim ​

abstract PimEnv pim()

Project specific presentation information model


read ​

Dict? read(Str filter, Bool checked := true)

Find the first record which matches the given filter string. Throw UnknownRecErr or return null based on checked flag. See Filter Chapter for filter format.


readAll ​

Grid readAll(Str filter)

Match all the records against a filter string and return as grid. See Filter Chapter for filter format.


readAllList ​

Dict[] readAllList(Str filter)

Match all the records against a filter string and return as list. See Filter Chapter for filter format. See readAll to return results as a grid.


readBin ​

@Deprecated { msg="Use virtual file system" } InStream readBin(Dict rec, Str tag)

Open an input stream to read the bin contents of the specified rec. If tag doesn't map to a Bin value, then throw UnknownNameErr. If the bin content has never been successfully written throw IOErr. It is critical that the input stream be closed upon completion.


readById ​

Dict? readById(Ref? id, Bool checked := true)

Convenience for readByIds


readByIds ​

Grid readByIds(Ref[] ids, Bool checked := true)

Read a list of records by ids into a grid. The rows in the result correspond by index to the ids list. If checked is true, then every id must be found in the project or UnknownRecErr is thrown. If checked is false, then an unknown record is returned as a row with every column set to null (including the id tag).


readByIdsList ​

Dict?[] readByIdsList(Ref[] ids, Bool checked := true)

Read a list of records by id. The resulting list matches the list of ids by index (null if record not found).


readCount ​

Int readCount(Str filter)

Return the number of records which match the given filter string.


rt ​

abstract ProjHxRuntime rt()

Haxall runtime APIs


sys ​

abstract Sys sys()

System reference


toStr ​

override Str toStr()

Return name


watch ​

abstract Watch? watch(Str id, Bool checked := true)

Find an open watch by its identifier. If not found then throw Err or return null based on checked flag. Also see Watches.


watchOpen ​

abstract Watch watchOpen(Str dis)

Open a new watch with given display string for debugging. Also see Watches.


watches ​

abstract Watch[] watches()

List the watches currently open for this project. Also see Watches.


writeBin ​

@Deprecated { msg="Use virtual file system" } OutStream writeBin(Dict rec, Str tag, Int? size)

Open an output stream to write the bin of the specified rec. If tag doesn't map to a Bin value, then throw UnknownNameErr. If the size of the bin content is known, then it should be given for efficiency, otherwise pass null. It is critical that the output stream be closed upon completion.


ProjBackup ​

abstract const class ProjBackup : Obj

ProjBackup models a single backup file.

Methods

deleteDelete the backup file which is an unrecoverable operation
inOpen an input stream to read the backup zip file
sizeSize in bytes of the backup zip file
tsTimestamp the backup was started

Slot Details ​


delete ​

abstract Void delete()

Delete the backup file which is an unrecoverable operation


in ​

abstract InStream in()

Open an input stream to read the backup zip file


size ​

abstract Int size()

Size in bytes of the backup zip file


ts ​

abstract DateTime ts()

Timestamp the backup was started


ProjHxRuntime ​

const mixin ProjHxRuntime : HxRuntime

Project implementation of HxRuntime

Methods

proj

Slot Details ​


proj ​

abstract Proj proj()


ProjTest ​

abstract class ProjTest : HaystackTest

ProjTest is the base class for writing SkyArc tests which need access to a booted Sys. Tests annotated with DbTest are run with a fully booted project database:

@DbTest
Void testBasics()
{
  x := addRec(["dis":"It works!"])
  y := proj.readById(x.id)
  verifyEq(y.dis, "It works!")
}

Methods

addExtAnd an extension to proj and automatically add all the dependent extensions
addRecAdd a record to proj using the given map of tags.
commitConvenience for commit to proj
evalEvaluate an Axon expression using a super user context.
projTest project if @DbTest configured on test method
readByIdConvenience for readById on proj
setupIf @DbTest configured then open proj
sysStandard test Sys instance
teardownIf @DbTest configured then close down proj

Slot Details ​


addExt ​

Ext addExt(Str extName, Str:Obj? tags := [Str:Obj?][:])

And an extension to proj and automatically add all the dependent extensions


addRec ​

virtual Dict addRec(Str:Obj? tags := [Str:Obj?][:])

Add a record to proj using the given map of tags.


commit ​

virtual Dict? commit(Dict rec, Obj? changes, Int flags := 0)

Convenience for commit to proj


eval ​

Obj? eval(Str axon)

Evaluate an Axon expression using a super user context.


proj ​

Proj? proj(Bool checked := true)

Test project if @DbTest configured on test method


readById ​

virtual Dict? readById(Ref id, Bool checked := true)

Convenience for readById on proj


setup ​

virtual override Void setup()

If @DbTest configured then open proj


sys ​

virtual Sys sys()

Standard test Sys instance


teardown ​

virtual override Void teardown()

If @DbTest configured then close down proj


Setting ​

@Serializable facet class Setting : Obj, Facet

Facet to annotate a Settings field.

Fields

metaMeta data for the def encoded as a Trio string.
placeholderText field place holder string
restartIs restart required before a change takes effect

Slot Details ​


meta ​

const Str meta := ""

Meta data for the def encoded as a Trio string. See the docs for ValDef meta for more details.


placeholder ​

const Str? placeholder

Text field place holder string


restart ​

const Bool restart

Is restart required before a change takes effect


Settings ​

const class Settings : Obj

Settings models the configuration of a system module or extension. It reflects Fantom fields to determine the different configuration settings, and then keeps them mapped them from the module/extension record. All subclasses must create an it-block constructor and annotate fields to configure with the Setting facet.

Slot Details ​


Sys ​

const class Sys : Obj

Sys is the top-level API to access SkyArc framework

Fields

homeDirHome dir where system is installed (parent for bin, lib, etc)
hostHost module
logLog module
userUser module
varDirVariable dir where database files, logs, etc are stored
versionSystem version

Methods

modLookup system module
modsSystem modules
rtSystem HxRuntime

Slot Details ​


homeDir ​

const File homeDir

Home dir where system is installed (parent for bin, lib, etc)


host ​

const HostMod host

Host module


log ​

const LogMod log

Log module


mod ​

SysMod? mod(Str name, Bool checked := true)

Lookup system module


mods ​

SysMod[] mods()

System modules


rt ​

SysHxRuntime rt()

System HxRuntime


user ​

const UserMod user

User module


varDir ​

const File varDir

Variable dir where database files, logs, etc are stored


version ​

const Version version

System version


SysHxRuntime ​

const mixin SysHxRuntime : HxRuntime

Sys implementation of HxRuntime

Slot Details ​


SysMod ​

abstract const class SysMod : HxLib

SysMod is a system module which plugs into the SkyArc framework

Methods

settingsModule settings
sysSys reference

Slot Details ​


settings ​

virtual Settings settings()

Module settings


sys ​

Sys sys()

Sys reference


UserMod ​

abstract const class UserMod : SysMod

UserMod manages the user database

Methods

authenticateAuthenicate user for given web request.
userFind a user account by Ref id or Str username.
usersList all configured users

Slot Details ​


authenticate ​

abstract Session? authenticate(WebReq req, WebRes res, Dict? opts := null)

Authenicate user for given web request. If the request is for an unauthenticated user, then redirect to the login page and return null.

Options:


user ​

abstract User? user(Obj id, Bool checked := true)

Find a user account by Ref id or Str username. Return null or throw err if not found.


users ​

abstract User[] users()

List all configured users


Watch ​

abstract const class Watch : HxWatch

Watch is a subscription to a set of records in a project. It provides an efficient mechanism to poll for changes. Also see Watches.

Methods

projProject associated with this watch

Slot Details ​


proj ​

abstract Proj proj()

Project associated with this watch


XQuery ​

abstract class XQuery : Obj

XQuery is used to perform distributed queries across the cluster

Constructors

makeContextConstruct for given context

Methods

defineDefine a variable available to subsequent Axon expressions.
evalEvaluate an Axon expression in each project
executeExecute the query and return the results
findAllFilter the previous Grid or Dict[] results with given expression.
flatMapApply the given Axon expression to the previous Grid or Dict[] results (typically a rec read operation) to map to zero or more new items.
hisReadRead histories for the target recs using same semantics as hisRead.
hisRollupPerform rollup on history data.
hisRollupAutoPerform rollup on history data using semantics of hisRollupAuto.
mapApply the given Axon expression to the previous Grid or Dict[] results (typically a rec read operation).
navProjsRestrict to the currently configured navigation projects.
pivotTransform the previous Grid or Dict[] results into a pivot table.
projsRestrict query to given project name(s)
readAllConvenience for readAllList which aggregates results to a Grid.
readAllListRead records by filter.
readByIdsConvenience for readByIdsList which aggregates results to a Grid.
readByIdsListRead recs by id.
sysSys reference
timeoutSet timeout to use for network calls to remote nodes.
useReplicasRoute this query to replicas if available instead of master nodes.
userUser context

Slot Details ​


define ​

abstract This define(Str name, Obj? val)

Define a variable available to subsequent Axon expressions. This provides an easy way to marshall data across the cluster without encoding data to an Axon expression.


eval ​

abstract This eval(Str expr)

Evaluate an Axon expression in each project


execute ​

abstract XQueryResult execute()

Execute the query and return the results


findAll ​

abstract This findAll(Str expr)

Filter the previous Grid or Dict[] results with given expression. The expression must be a function with one parameter takes a Dict and returns a Bool (true to include, false to exclude).


flatMap ​

abstract This flatMap(Str expr)

Apply the given Axon expression to the previous Grid or Dict[] results (typically a rec read operation) to map to zero or more new items. The expression must be a function with one parameter which is the previous pipeline Dict to map and it must return a Dict[].


hisRead ​

abstract This hisRead(Obj? span, Obj? opts := null)

Read histories for the target recs using same semantics as hisRead. Note that null does not read the entire range for points, but rather defaults to system default span.


hisRollup ​

abstract This hisRollup(Obj fold, Obj interval)

Perform rollup on history data. The rollup function must be a named function available in all nodes. The rollup follows same semantics as hisRollup.


hisRollupAuto ​

abstract This hisRollupAuto(Obj? interval := null)

Perform rollup on history data using semantics of hisRollupAuto. Note that only an interval parameter is available in this version.


makeContext ​

static new makeContext(Context cx := Context.cur(), Dict? opts := null)

Construct for given context


map ​

abstract This map(Str expr)

Apply the given Axon expression to the previous Grid or Dict[] results (typically a rec read operation). The expression must be a function with one parameter which is the previous pipeline Dict to map and it must return the mapped Dict.


abstract This navProjs()

Restrict to the currently configured navigation projects. Convenience for calling projs with navProjNames() Axon function.


pivot ​

abstract This pivot(Dict shape)

Transform the previous Grid or Dict[] results into a pivot table. Also see pivot() and Axon Usage


projs ​

abstract This projs(Obj names)

Restrict query to given project name(s)


readAll ​

abstract This readAll(Obj filter, Obj? opts := null)

Convenience for readAllList which aggregates results to a Grid.


readAllList ​

abstract This readAllList(Obj filter, Obj? opts := null)

Read records by filter.


readByIds ​

abstract This readByIds(Obj ids)

Convenience for readByIdsList which aggregates results to a Grid.


readByIdsList ​

abstract This readByIdsList(Obj ids)

Read recs by id. Results are not ordered the same as ids. Any ids not found or currently unavailable are silently ignored.


sys ​

abstract Sys sys()

Sys reference


timeout ​

abstract This timeout(Duration val)

Set timeout to use for network calls to remote nodes. Default uses queryTimeout value from settings


useReplicas ​

abstract This useReplicas(Bool val := true)

Route this query to replicas if available instead of master nodes. Default is false.


user ​

abstract User user()

User context


XQueryResult ​

abstract const class XQueryResult : Obj

Result of XQuery.execute

Methods

dictGet the result as one Dict.
dictsGet results as a list of Dicts
gridGet results as a grid
listGet results as a list
valGet the raw value

Slot Details ​


dict ​

abstract Dict? dict(Bool checked := true)

Get the result as one Dict. If there is no results then raise UnknownRecErr or return null based on checked flag. If there are more than one result then return just one.


dicts ​

abstract Dict[] dicts()

Get results as a list of Dicts


grid ​

abstract Grid grid()

Get results as a grid


list ​

abstract Obj?[] list()

Get results as a list


val ​

abstract Obj? val()

Get the raw value