Home > @activeviam/activeui-sdk > MdxQuery
MdxQuery interface
A MDX query on a given server.
Signature:
export interface MdxQuery
Remarks
A MdxQuery has two ids: clientId and serverId:
clientId: a unique id among all the queries in this loaded ActiveUI application. Used to find again a query in the queries pool. This id is assigned when the query is created and never changes. This is the same ID we will use to match the server 'streamId' notion.
serverId: a id that changes every time the mdx or the context values of this query change. This is the id we send to the server so that we can match WebSocket queries updates with their corresponding query state (especially drop updates that we receive just after having changed the MDX for instance because they are not consistent with the cellSet we expect to have with this MDX). This id is also unique among all running queries in this loaded ActiveUI application.
Properties
Property | Type | Description |
---|---|---|
_getMultiBinding | () => MultiBinding | |
_waitUntilLoaded | () => Promise<void> | |
addListener | (a: (a: Table) => void) => RemoveListener | Add a listener that will be called when the server send an update for this query. |
cancel | () => void | |
dispose | () => void | Stop the query and unregister all the internal listeners. |
executeOnceAndGetPromise | () => Promise<CellSet> | |
getContext | () => MdxContextValues | |
getDataSource | () => MdxSelectDataSource | |
getId | () => QueryId | |
getMdx | () => Mdx | |
getPlaygroundBinding | () => BindingWrapper | |
getRanges | () => Ranges | |
getRefreshInterval | () => number | |
getUpdateMode | () => UpdateMode | |
hasStarted | () => boolean | |
isRealTime | () => boolean | Check whether the query is currently running continuously. |
refresh | () => void | |
refreshAndGetPromise | () => Promise<CellSetMessage | null | undefined> | |
refreshPeriodically | (refreshInterval: number) => MdxQuery | Start the query in refresh periodically mode, and publish results to the feed |
setContext | (contextValues: MdxContextValues) => MdxQuery | Change the query context values and restart the query if currently running. |
setMdx | (mdx: Mdx) => MdxQuery | Change the query MDX and restart the query if currently running. |
setRanges | (ranges: Ranges) => MdxQuery | |
setRefreshInterval | (refreshInterval: number) => void | |
start | (updatedMode?: UpdateMode, refreshInterval?: number) => MdxQuery | Start the query and publish the results to the feed. |
stop | () => MdxQuery | Stop the continuous query. |
toggle | () => MdxQuery | Toggle the query state: start it if stopped and stop it if started. |
update | (mdx: Mdx, context: MdxContextValues, updateMode: UpdateMode, refreshInterval: number) => MdxQuery | Change the query MDX and/or context values and/or updateMode atomically. If the query is currently running, it will be stopped and started again with the new parameters. |
waitUntilLoaded | () => Promise<LoadingState> | Wait for a query to finish loading, and resolve with its status as a LoadingState. If there is an error during the query execution, the promise is rejected with that error. If the query is not pending, resolve with its current status. |