Skip to Content
ModulesScript Context Members

Script Context Members

Kubling injects bound objects into a script according to the contract of that script type. They provide controlled access to input values, result builders, logging, HTTP calls or Engine operations without exposing unrestricted host access.

This reference covers Script Data Sources, functions, authentication delegates, Endpoint Scripts, scheduled scripts and JavaScript routing resolvers. A script receives only the members listed for its execution context.

Script Data Source

For more information see here.

Common to all script types

contextVars

An object whose properties combine environment variables and application properties.

In JavaScript, properties can be accessed with dot notation or computed property names. See Application variables for configuration and precedence.

global

A common, shared, thread-safe key-value store. The difference between this and contextVars is the scope: global has only one instance per Engine instance, so it is Engine-scoped, whereas contextVars is Script-scoped, making global suitable for sharing information between script contexts.

FunctionDescription
put(key : string, value : object)Associates the specified value object with the specified key. If the store previously contained a mapping for the key, the old value is replaced by the specified value.
remove(key : string)Removes the mapping for a key from the store if it is present.
get(key : string)Returns the value to which the specified key is mapped, or null if the store does not contain mapping for the key.
containsKey(key : string) : booleanReturns true if the store does not contain a mapping for the specified key.
isEmpty() : booleanReturns true if the store does not contain key-value mappings.
keys() : <string>Returns an iterable wrapper, containing the list of keys, that is resolved by the script context as a native feature. For example, in JavaScript it will allow you to use a for (variable of iterable) loop.
values() : <object>Returns an iterable wrapper, containing the list of values, that is resolved by the script context as a native feature.
forEach(action)Direct support for the standard forEach form when the particular script context or the language does not support it. For example, in JavaScript it is recommended the usage of forEach(callbackFn) instead.
size() : integerReturns the number of elements in the store.

helper

Convenience class with some functionality not always included in a scripting language spec, like the ECMAScript.

FunctionDescription
toLong(object) : longTransforms an object to its long representation.
toInt(object) : integerTransforms an object to its integer representation.
base62(string) : stringEncodes a string to base62.
base62Decode(string) : stringDecodes a string from base62.
base64(string) : stringEncodes a string from base64.
base64Decode(string) : stringDecodes a string from base64.
compressString(string) : stringCompresses a string using the basic gzip deflater.
decompressString(string) : stringDecompresses a string using the basic gzip inflater.
encryptString(string) : stringEncrypts a string using a random key, which is created when the engine starts, and AES/CBC/PKCS5Padding cipher.
decryptString(string) : stringDecrypts a string encrypted via encryptString.
asJson(object) : stringTransforms an object to its json representation.
asJsonPretty(object) : stringTransforms an object to its prettified json representation.
unescapeJson(string) : stringUnescape a json document, which removed escape chars.
isValidJson(string) : booleanReturns whether an arbitrary text is a valid json document.
asYaml(object) : stringTransforms an object to its yaml representation.
dt() : DateTimeHelperReturns a DateTimeHelper object.
jsonPath() : JSONPathReturns a JSONPath object.

The helper functions list will grow in future versions as we identify more requirements/uses cases reported by users.

helper.DateTimeHelper

All values are expressed in EPOCH/Unix time .

FunctionDescription
nowMillis() : longReturns the current time in milliseconds.
nowSeconds() : longReturns the current time in seconds.
nowPlusSeconds(seconds : long) : longReturns the current time in milliseconds after adding the specified amount of seconds.
nowPlusMillis(millis : long) : longReturns the current time in milliseconds after adding the specified amount of milliseconds.
nowPlusMinutes(minutes : long) : longReturns the current time in milliseconds after adding the specified amount of minutes.
nowPlusHours(hours : long) : longReturns the current time in milliseconds after adding the specified amount of hours.
nowPlusDays(days : long) : longReturns the current time in milliseconds after adding the specified amount of days.
nowPlusMonths(months : long) : longReturns the current time in milliseconds after adding the specified amount of months.
nowPlusYears(years : long) : longReturns the current time in milliseconds after adding the specified amount of years.
fromMillisToSeconds(millis : long) : longTransforms milliseconds to number of seconds.
fromSecondsToMillis(seconds : long) : longTransforms seconds to number of milliseconds.
helper.JSONPath

Allows to perform basic operations using JSON Path .

FunctionDescription
read(document : string, path : string) : ListProxyObject<string>Parses a JSON document and read the specified path. The result is a list of matches.
excludeListedFields(document : object, fields : string[]) : stringGenerates a new JSON document, based on the original, with the specified fields excluded.
excludeNonListedFields(document : object, fields : string[]) : stringGenerates a new JSON document, based on the original, keeping only the specified fields and excluding the rest.

httpCli

httpCli executes HTTP and HTTPS requests from Script Data Sources, functions, endpoints, authentication delegates and scheduled scripts. Requests reuse process-owned outbound transports and release their responses after the body is materialized.

const request = httpCli.request() .url("https://inventory.example.com/v1/devices") .method("POST") .header("X-Tenant", contextVars.TENANT_ID) .basicAuth(contextVars.API_USER, contextVars.API_PASSWORD) .contentType("application/json") .contentCharset("utf-8") .body({ status: "active" }) .timeout(15000); const response = httpCli.execRequest(request); if (response.statusCode < 200 || response.statusCode >= 300) { throw new Error(`Inventory request failed: ${response.statusCode}`); } return response.content;

Non-success HTTP responses are returned as HTTPResponse objects; they do not raise an exception solely because of their status code.

FunctionDescription
request() : HTTPRequestCreates a fluent request object.
execRequest(request : HTTPRequest) : HTTPResponseExecutes the request and returns its response.
newFileWrapper(name : string) : FileWrapperCreates a file part for a multipart form.
exec(request : object) : HTTPResponseCompatibility API based on a plain object. Deprecated since 26.2; use request() and execRequest().
HTTPRequest

Request methods return the same object, so they can be chained:

MethodDefaultPurpose
url(value)requiredSets the target URL.
method(value)GETSets the HTTP method. A GET request cannot contain a body.
timeout(milliseconds)30000Sets the response read timeout. 0 means no timeout.
followRedirects(enabled)falseControls automatic redirects.
param(name, value)—Adds a query parameter.
header(name, value)—Adds a request header.
body(value)—Sets a raw string or serializable request body.
form(name, value)—Adds a multipart or URL-encoded form field.
formUrlEncoded(enabled)falseUses application/x-www-form-urlencoded instead of multipart form data.
basicAuth(username, password)—Adds HTTP Basic credentials.
contentType(value)application/jsonSets the request body media type.
contentCharset(value)utf-8Sets the charset used to encode the request body.
userAgent(value)kublingSets the User-Agent header.
accept(value)—Sets the Accept header.
decodeUrl(enabled)trueControls decoding of an already encoded URL.
doNotValidateCertificate(enabled)falseDisables certificate and hostname validation for this request only.

headers(), params() and form() expose their corresponding mutable maps when a script needs direct map-style access.

HTTPResponse
PropertyMeaning
statusCodeNumeric HTTP status.
statusMessageHTTP status text.
contentTypeResponse media type, including its declared charset when present.
headersRead-only response headers.
contentComplete response body decoded with the declared charset, or UTF-8 when none is declared.
TLS and response limits v26.7+

HTTPS certificate and hostname validation is enabled by default. Configure a private trust store at application level when a service uses a private certificate authority:

keytool -importcert \ -alias internal-root \ -file internal-root.pem \ -keystore private-roots.p12 \ -storetype PKCS12

keytool prompts for the store password and certificate confirmation. Mount the resulting file into Kubling, then configure the shared outbound client:

outboundHttp: maxResponseBytes: 16777216 trustStoreType: "PKCS12" trustStoreFilePath: "/etc/kubling/certs/private-roots.p12" trustStorePassword: "{{ OUTBOUND_HTTP_TRUST_STORE_PASSWORD }}"

The private roots are added to the platform trust roots; they do not replace them. trustStoreType defaults to PKCS12. Mount the store read-only and provide its password through the deployment’s secret mechanism rather than committing it with application configuration.

maxResponseBytes defaults to 16777216 bytes (16 MiB) and must be between 1 and 2147483647. It limits the complete response body materialized by an outbound request. Increase it only when the script genuinely needs a larger response and the process has sufficient memory.

doNotValidateCertificate(true) disables both certificate and hostname validation for one request and emits a warning when insecure mode is first used. Treat it only as a temporary migration aid. A private trust store does not fix a hostname mismatch; the certificate must also identify the URL’s host.

Scripts that previously depended on an untrusted certificate must add its CA to the trust store or opt into insecure mode on the individual request. Responses larger than 16 MiB must be reduced at the remote API or allowed by a deliberately higher maxResponseBytes value.

FailureCheck
TLS validation failsVerify the certificate chain, trust-store path, password, type and hostname.
Basic authentication is rejectedVerify the credentials and use basicAuth() instead of constructing the header manually.
Response exceeds the configured limitRequest a smaller representation or review outboundHttp.maxResponseBytes.
Text is decoded incorrectlyConfirm the response charset and the request’s contentCharset.

The generated application fields are available under Main Application Configuration.

Legacy exec() request

Existing scripts may continue passing a plain object to exec():

const response = httpCli.exec({ url: "https://inventory.example.com/v1/devices", method: "GET", timeout: 15000, followRedirects: false, doNotValidateCertificate: false, headers: { "X-Tenant": contextVars.TENANT_ID }, credentials: { username: contextVars.API_USER, password: contextVars.API_PASSWORD } });

The object also accepts params, body, form, formUrlEncoded, contentType, contentCharset, userAgent and accept. New scripts should use the fluent API shown above.

FileWrapper

A FileWrapper represents one file in a multipart form:

FunctionDescription
setContent(content: byte[])Replaces the file content.
addContent(content: byte[])Appends bytes to the file content.
getContent() : byte[]Returns the current content.
setType(type : string)Sets the file media type.

logger

FunctionDescription
debug(message: object)Log a message at the DEBUG level.
debug(context : string, message: object)Log a message at the DEBUG level, with a context you can add to recognize it.
info(message: object)Log a message at the INFO level.
info(context : string, message: object)Log a message at the INFO level, with a context you can add to recognize it.
warn(message: object)Log a message at the WARN level.
warn(context : string, message: object)Log a message at the WARN level, with a context you can add to recognize it.
error(message: object)Log a message at the ERROR level.
error(context : string, message: object)Log a message at the ERROR level, with a context you can add to recognize it.

logger will always attempt to transform the object into a printable string representation. If that transformation is not possible, it will print [object].

The logger cannot access the script’s call trace, making it impossible to print the exact file and line number that triggered the call.
We are investigating how to improve it.

DBEngine

Allows scripts to execute queries and update operations directly against the Engine.

Operations are executed within the current authentication context unless a privileged variant is explicitly used.

FunctionDescription
executeQuery(vdbName : string, query : string) : QueryResultProxyObjectExecutes a SELECT statement and returns a QueryResultProxyObject.
execute(vdbName : string, query : string) : booleanExecutes arbitrary SQL and reports whether it produced a result.
executeUpdate(vdbName : string, query : string) : integerExecutes an update statement and returns affected rows.
executeUpdateWithParams(vdbName : string, command : SqlCommand) : integerExecutes one parameterized update and returns affected rows.
executeTransaction(vdbName : string, commands : string[]) : integerExecutes update statements as one transaction and returns total affected rows.
executeTransactionWithParams(vdbName : string, commands : SqlCommand[]) : integerExecutes parameterized updates as one transaction and returns total affected rows.
explain(vdbName : string, query : string) : stringReturns the engine execution plan for a query.
getTableNamesByTags(vdbName : string, schemaName : string, tags : string[]) : string[]Returns tables in one schema that match every supplied tag.

All methods above use the current authentication context and preserve its authorization result. They never elevate privileges automatically.

The following explicit variants run with Kubling’s deployment-level privileged identity:

FunctionDescription
executeQueryPrivileged(vdbName : string, query : string) : QueryResultProxyObjectPrivileged form of executeQuery.
executePrivileged(vdbName : string, query : string) : booleanPrivileged form of execute.
executeUpdatePrivileged(vdbName : string, query : string) : integerPrivileged form of executeUpdate.
executeUpdateWithParamsPrivileged(vdbName : string, command : SqlCommand) : integerPrivileged parameterized update.
executeTransactionPrivileged(vdbName : string, commands : string[]) : integerPrivileged transaction over SQL strings.
executeTransactionWithParamsPrivileged(vdbName : string, commands : SqlCommand[]) : integerPrivileged transaction over parameterized commands.
explainPrivileged(vdbName : string, query : string) : stringPrivileged form of explain.

Privileged methods bypass the caller’s identity by design. Treat any bundle that invokes them as trusted executable configuration: review it, restrict who can publish it and keep its effects observable.

resultSetScript

resultSet

A proxy object that contains the rows returned by the script.

FunctionDescription
addRow(row: string)Adds a JSON or YAML document to the set.
addRow(rows: string[])Adds array of rows to the set.
dataFormat(df: string)Specified the format of the documents contained by the set. Can be either JSON or YAML.

queryFilter

Filter information. See QueryFilterProxyObject type.

insertScript

insertOperation

An object that contains only members (not functions), which describes the insert operation.

MemberDescription
table : stringTABLE name.
fieldValues : ListProxyObject<SetOperationProxyObject>Returns the list of fields and values of the operation. Elements of the List are of SetOperationProxyObject type.
jsonList : ListProxyObject<string>Returns the list of final documents to be inserted. When the original insertion occurred in a synthetic TABLE, the document received is the final one, that is, the root document with a new nested document. For more information see here.
yamlList : ListProxyObject<string>Same as jsonList but in YAML format.
originalJsonList : ListProxyObject<string>It returns the list of original documents before the insertion. It is only valid when the TABLE is synthetic, otherwise list is always empty.
originalYamlList : ListProxyObject<string>Same as originalJsonList but in YAML format.
differences : ListProxyObject<JsonDifferenceResultProxyObject>Returns the list of differences detected when compared to the original document.
Position matches jsonList and originalJsonList, therefore differences[index] uses jsonList[index] and originalJsonList[index] to make the comparison.
Elements of the List are of JsonDifferenceResultProxyObject type.

affectedRows

Must specify the number of documents effectively created/inserted during the operation.

updateScript

updateOperation

An object that contains only members (not functions), which describes the update operation.

MemberDescription
table : stringTABLE name.
updates : ListProxyObject<SetOperationProxyObject[]>Returns the list of changes in documents, each entry is a list of fields and values updated of the operation.
The reason why this returns a list of documents, is because an UPDATE may affect multiple documents, depending on the search result.
queryFilter : QueryFilterProxyObjectReturns the WHERE clause of the update operation. See QueryFilterProxyObject type.
jsonList : ListProxyObject<string>Returns the list of final documents, with its values updated. When the TABLE is synthetic, the document received is the final one, that is, the root document with a new nested document. For more information see here.
yamlList : ListProxyObject<string>Same as jsonList but in YAML format.
originalJsonList : ListProxyObject<string>It returns the list of original documents before the update.
originalYamlList : ListProxyObject<string>Same as originalJsonList but in YAML format.
differences : ListProxyObject<JsonDifferenceResultProxyObject>Returns the list of differences detected when compared to the original document.
Position matches jsonList and originalJsonList, therefore differences[index] uses jsonList[index] and originalJsonList[index] to make the comparison.
Elements of the List are of JsonDifferenceResultProxyObject type.
partialJsonList : ListProxyObject<string>Returns a list of documents containing only the fields that were changed. Difference between this and updates, is that this member returns a valid JSON.
partialYamlList : ListProxyObject<string>Same as partialJsonList but in YAML format.

affectedRows

Must specify the number of documents effectively updated during the operation.

deleteScript

deleteOperation

An object that contains only members (not functions), which describes the delete operation.

MemberDescription
table : stringTABLE name.
queryFilter : QueryFilterProxyObjectReturns the WHERE clause of the delete operation. See QueryFilterProxyObject type.
jsonList : ListProxyObject<string>Returns the list of documents to be deleted.
yamlList : ListProxyObject<string>Same as jsonList but in YAML format.

affectedRows

Must specify the number of documents effectively deleted during the operation.

initScript

initResult

An object that indicates to the Engine the result of the initialization.

FunctionDescription
initialized()Marks the initialization process as correctly initialized.
error()Marks the initialization process as erroneous.
error(message : string)Marks the initialization process as erroneous with a custom message.

scheduledScript v26.5+

Scheduled scripts receive the common members and DBEngine. This applies to scripts launched from a trusted descriptor or script bundle, where no interactive caller may be present.

Use a normal DBEngine method when the schedule has an authenticated execution context. If that context is absent, the method fails authorization rather than elevating itself. Use a *Privileged method only when the scheduled operation is intentionally owned by the deployment.

A scheduled script cannot select a separate configurable service identity. Privileged calls run with Kubling’s deployment-level identity. Until a dedicated identity is available, descriptor-bundle review and deployment controls are the security boundary.

JavaScript routing resolver v26.7+

A resolver configured on a ROUTING Data Source runs in an isolated JavaScript context. The configured function receives request as its only argument and can use these bound objects:

MemberPurpose
contextVarsReads application and Data Source variables.
RoutingCreates the routing decision returned by the function.
DBEngineRuns bounded, read-only SQL when the decision depends on current data.
loggerWrites debug, info or warn messages.

request

request is read-only and describes the command currently being routed:

MemberContent
operationSELECT, INSERT, UPSERT, UPDATE or DELETE
vdbName, vdbVersionActive VDB identity
schemaName, tableNameRouted schema and canonical table name
valuesCanonical column names mapped to literal, prepared or dependent values found in the predicate
rowValues of an INSERT or UPSERT; empty for other operations
changesValues assigned by an UPDATE; empty for other operations
predicateStructured tree representing the complete command predicate
sessionAvailable requestId, sessionId, userName and transactional state
candidateRoutesImported Data Source names for this table, in configuration order

For ordinary routing policies, use values, row and changes. Inspect predicate only when the logical structure of the complete WHERE condition affects the decision.

Advanced: complete predicate tree

predicate is a structured representation of the SQL condition, not SQL text. For example, tenant_id = 'acme' AND active = true is represented as an and node whose left and right members are comparison nodes.

Boolean nodes use kind: "and", kind: "or" or kind: "not". Predicate nodes use comparison, in, isNull or like. Their expressions are column or literal nodes containing the canonical name, type and value. A condition that cannot be represented safely uses kind: "unsupported".

When an advanced policy depends on this tree, reject or fan out on an unsupported node instead of inferring a route.

contextVars v26.7.1+

contextVars combines the application variable set with the properties declared on the ROUTING Data Source. A Data Source value takes precedence when both scopes use the same name. A static routing table can therefore be maintained outside the descriptor script:

propertiesFilePath: "/etc/kubling/routing.properties"
ROUTE_ACME=clients_eu ROUTE_GLOBEX=clients_us

The resolver can read a value with dot notation or a computed property name, for example contextVars.ROUTE_ACME or contextVars[variableName]. Maps and lists are exposed as a recursive read-only snapshot for the lifetime of the resolver. See Application variables for inline properties, environment variables, files and precedence.

Use contextVars when the mapping changes only with deployment configuration. It avoids a SQL query for every routing decision. Use DBEngine when the mapping is live data that must change without reconfiguring the application.

Routing

FunctionDecision
routes(name)Selects one exact candidate route.
routes(names)Selects an ordered array of exact candidate routes.
fanOut()Selects every candidate route for a read.
reject(message)Stops the command with an explicit diagnostic.

The function must return one of these decision objects. A plain JavaScript object is not a routing decision.

DBEngine

DBEngine.query(sql, parameters) executes a bounded, read-only query against authorized physical tables in the active VDB. It returns:

MemberContent
columnsResult column metadata
rowsResult rows as positional arrays
rowCountNumber of returned rows

Tables must be qualified as schema.table. The API rejects writes, DDL, procedures, functions, views, temporary and system objects, the routing schema currently being resolved and direct or transitive routing cycles. Resolver configuration bounds query count, rows, bytes and execution time.

logger

The routing logger exposes debug(message), info(message) and warn(message). It does not expose the two-argument overloads available to other script types.

The resolver context does not include global, helper or httpCli, and it has no generic filesystem, process, thread, native, host-class or unrestricted polyglot access.

Template function

Only common members.

SQL script function

Only common members.

Authentication/Authorization script

auth

An object used to exchange authentication and session-establishment information between the script and the session manager.

FunctionDescription
authenticationSource : stringIndicates which transport or entry point initiated the authentication request. Possible values include SOCKET_TRANSPORT and HTTP.
userName : stringContains the username provided by the remote client during session initialization.
credentials : stringContains the credentials (such as a password or token) provided by the remote client during session initialization.
metadata : objectContains metadata associated with the authentication request. For HTTP-based authentication, this object includes the request headers.
httpAuthenticationType : stringIndicates the HTTP authentication mechanism detected by the engine. See below for details.
trust()Accepts the authentication request and allows the remote client to establish a persistent session.
bad()Rejects the authentication request due to invalid credentials or authentication failure.
bad(message : string)Same as bad(), but allows a custom reason message to be returned to the remote client.
locked()Rejects the authentication request because the user is locked or disabled.
locked(message : string)Same as locked(), but allows a custom reason message to be returned to the remote client.
addPrincipal(name : string)Associates a principal with the authenticated session.
addRole(name : string)Associates a role with the authenticated session.

HTTP Authentication Type Detection

When authentication is initiated through the HTTP transport, Kubling attempts to infer the authentication mechanism used by the remote client and exposes the result through auth.httpAuthenticationType.

The detected type reflects how credentials or identity information were presented to the engine, independently of whether the authentication request is ultimately accepted or rejected.

Possible values are:

ValueDescription
BEARERThe request contains an Authorization: Bearer header.
BASICThe request contains an HTTP Basic Authentication header.
MTLSAuthentication information was derived from a mutually authenticated TLS session.
API_KEYThe request contains an API key recognized by the configured authentication initiator.
NONENo recognizable HTTP authentication mechanism was detected.

Endpoint Script

httpRequest

An object that provides full access to the incoming HTTP request made by a remote client.
It exposes standard request metadata, headers, query/form parameters, and the message body.

FunctionDescription
method() : stringReturns the HTTP method of the request (e.g., GET, POST, DELETE).
contentType() : stringReturns the value of the Content-Type header, or null if not present.
contentLength() : numberReturns the length of the request body in bytes, or -1 if unknown.
headerNames() : string[]Returns a list of all header names present in the request.
header(name : string) : stringReturns the first header value for the given name, or null if not present.
headers(name : string) : string[]Returns all header values for the given name.
parameterNames() : string[]Returns a list of all query/form parameter names.
param(name : string) : stringReturns the first value for the specified parameter, or null if not found.
paramValues(name : string) : string[]Returns all values for the specified parameter name.
body() : stringReturns the full request body as a UTF-8 string. Cached after the first access.
bodyAs(charset : string) : stringReturns the request body using the specified charset (e.g., "ISO-8859-1"). Defaults to UTF-8.

httpResponse

An object used to build the HTTP response to be sent back to the client.
Supports text, JSON, HTML, and binary (base64) content, along with full control over headers, status codes, and cookies.

FunctionDescription
status() : numberReturns the current HTTP status code.
status(code : number) : httpResponseSets the HTTP status code (e.g., 200, 404, 500).
header(name : string, value : string) : httpResponseSets or replaces a header.
addHeader(name : string, value : string) : httpResponseAdds an additional value to a multi-valued header.
removeHeader(name : string) : httpResponseRemoves the specified header.
headerNames() : string[]Returns all header names.
headers(name : string) : string[]Returns all values for the specified header.
contentType() : stringReturns the current Content-Type value.
contentType(type : string) : httpResponseSets the Content-Type (e.g., application/json, text/html).
charset() : stringReturns the current character encoding. Default is UTF-8.
charset(charset : string) : httpResponseSets the character encoding (e.g., ISO-8859-1).
text(body : string) : httpResponseSets the response body as plain text. Sets Content-Type to text/plain; charset=UTF-8 unless already defined.
html(body : string) : httpResponseSets the response body as HTML. Sets Content-Type to text/html; charset=UTF-8 unless already defined.
json(value : object) : httpResponseSerializes an object or JSON string and sets it as the response body. Sets Content-Type to application/json.
base64(body : string, mimeType : string) : httpResponseSends a binary body encoded as Base64. Optionally sets the MIME type.
noContent() : httpResponseClears the body and sets status to 204 if not already set.
cookie(name : string, value : string) : httpResponseAdds a basic cookie with default attributes.
cookie(name : string, value : string, attributes : object) : httpResponseAdds a cookie with attributes. See below.
cookies() : object[]Returns a list of cookies that will be sent in the response.

General

ListProxyObject

A List of elements created in the engine and exposed to the script context.
Its functions are only proxies that point to the original, non-script-compatible array.

FunctionDescription
forEach(action)Direct support for the standard forEach form when the particular script context or the language does not support it. For example, in JavaScript it is recommended the usage of array.forEach((element) => ...); instead.
isEmpty() : booleanReturns true if the array has no elements.
array() : object[]Returns all elements as an array of object.
stringify() : string[]Returns an array containing the string representation of the elements in the array.
iterable() : <object>Returns an iterable wrapper that is resolved by the script context as a native feature. For example, in JavaScript it will allow you to use a for (variable of iterable) loop.
get(pos : integer) : objectReturns the object at the specified position in the array.
getFirst() : objectReturns the first object of the array.
getLast() : objectReturns the last object of the array.
size() : integerReturns the number of elements in the array.

QueryFilterProxyObject

An object that contains only members (not functions), which describes the filter, or WHERE clause, of the query.

MemberDescription
filters : ListProxyObject<FilterValue>Returns the list of filters. Elements of the List are of FilterValue type.
sort : ListProxyObject<QueryFilterSort>Returns the requested sort (ORDER BY). Elements of the List are of QueryFilterSort type.
pagination : QueryPageFilterProxyObjectReturns the requested pagination (LIMIT). See proxy information.
table : stringQuery table name.
json : stringSelf-representation in JSON format.
yaml : stringSelf-representation in YAML format.

FilterValue full schema:

type: "object" id: "schema:kubling:connectors:translation:scripting:base:member:filter:FilterValue" properties: field: type: "string" description: "Name of the field to be evaluated." dataType: type: "string" description: "Engine data type of the field." value: type: "object" id: "schema:kubling:InnerObject" description: "Value used by the comparison operation." operation: type: "object" id: "schema:kubling:connectors:translation:scripting:base:member:proxy:EnumObject<com:kubling:connectors:translation:scripting:base:member:filter:FilterValue:Operation>" properties: value: type: "string" enum: - "EQUAL" - "NOT_EQUAL" - "GREATER_THAN" - "GREATER_THAN_OR_EQUAL" - "LESS_THAN" - "LESS_THAN_OR_EQUAL"

QueryFilterSort full schema:

type: "object" id: "schema:kubling:connectors:translation:scripting:base:member:filter:QueryFilterSort" properties: field: type: "string" orderType: type: "string" enum: - "ASC" - "DESC" - "FIRST" - "LAST"

QueryPageFilterProxyObject

An object that contains only members (not functions), which describes the filter, or LIMIT clause, of the query.

MemberDescription
pageSize : integerNumber of rows returned by the query.
page : integerPage to start from, also known as offset.
json : stringSelf-representation in JSON format.
yaml : stringSelf-representation in YAML format.

SetOperationProxyObject

An object that contains only members (not functions), with values passed to the operation.

MemberDescription
fieldName : stringField name.
value : objectField value.
json : stringSelf-representation in JSON format.
yaml : stringSelf-representation in YAML format.

AffectedRows

A proxy object that contains the the number of rows affected by the operation.

MemberDescription
increment()Increments (1) the number of affected rows.
increment(number : integer)Increments a specified number of affected rows.
get() : integerReturns the current affected rows.
addGeneratedKey(colName : string, value : object) : integerRegisters a generated key for the given column name and propagates it to the engine. This allows generated values (for example, auto-increment identifiers) to be returned by the operation when supported. The engine will attempt to transform the provided value from the script data type into the table column data type. Transformation failures result in execution errors.

JsonDifferenceResultProxyObject

An object that contains only members (not functions), that describes the result of a document comparison operation.

MemberDescription
added : ListProxyObject<string>List of fully qualified field names added to the document.
removed : ListProxyObject<string>List of fully qualified field names removed from the original document.
modified : ListProxyObject<string>List of fully qualified field names modified.
untouched : ListProxyObject<string>List of fully qualified field names that have not been modified.

QueryResultProxyObject

An object that contains the result set of query.

MemberDescription
count : integerReturns the number of rows contained in the result set.
countFields : integerReturns the number of columns (fields) contained in the result set.
fieldNames : ListProxyObject<string>List of field names returned by the query.
rows : ListProxyObject<object>Returns the actual rows of the result set. Each element is an native object, therefore fields can be accessed using dot-notation.
inspect : stringHuman-readable preview of the result set for debugging. v25.5+
Last updated on