On this page
Defines, removes and refreshes the saved queries of one grid.
Members
Methods
Checks the plan in the engine, then saves it as one undoable change.
Removes a saved query; its output table and values stay.
Refreshes one query and the queries it joins, as one undoable change.
Refreshes every query with an output table, as one undoable change.
Aborts pending refreshes and removes the grid's query commands. Later
refreshes resolve { status: "aborted" }, and later define and
remove calls throw a SheetwriteError with code unavailable.
Declaration
View full TypeScript declaration
export interface QuerySession {
Referenced by
Public exports naming QuerySession
interface SavedQuery {
readonly id: string;
readonly name: string;
readonly source: SavedQuerySource;
readonly steps: readonly QueryStep[];
readonly output?: SavedQueryOutput;
} interface SavedQuery {
readonly id : string ;
readonly name : string ;
readonly source : SavedQuerySource ;
readonly steps : readonly QueryStep [];
readonly output ?: SavedQueryOutput ;
} interface SavedQuery {
readonly id : string ;
readonly name : string ;
readonly source : SavedQuerySource ;
readonly steps : readonly QueryStep [];
readonly output ?: SavedQueryOutput ;
} One saved, refreshable query. Definitions never contain host credentials. API reference type QueryDefinitionResult =
| {
readonly status: "invalid";
readonly diagnostic: QueryDiagnostic;
}
| ApplyTransactionResult; type QueryDefinitionResult =
| {
readonly status : "invalid" ;
readonly diagnostic : QueryDiagnostic ;
}
| ApplyTransactionResult ; type QueryDefinitionResult =
| {
readonly status : "invalid" ;
readonly diagnostic : QueryDiagnostic ;
}
| ApplyTransactionResult ; A definition the engine rejects, or the store's transaction result. API reference type ApplyTransactionResult =
| {
status: "applied";
epoch: number;
transaction: Transaction;
warnings?: MutationIssue[];
rejections?: MutationIssue[];
}
| {
status: "conflict";
expectedEpoch: number;
actualEpoch: number;
}
| { status: "rejected"; epoch: number; issues: MutationIssue[] }
| {
// … 5 more lines — see the API reference
} type ApplyTransactionResult =
| {
status : "applied" ;
epoch : number ;
transaction : Transaction ;
warnings ?: MutationIssue [];
rejections ?: MutationIssue [];
}
| {
status : "conflict" ;
expectedEpoch : number ;
actualEpoch : number ;
}
| { status : "rejected" ; epoch : number ; issues : MutationIssue [] }
| {
} type ApplyTransactionResult =
| {
status : "applied" ;
epoch : number ;
transaction : Transaction ;
warnings ?: MutationIssue [];
rejections ?: MutationIssue [];
}
| {
status : "conflict" ;
expectedEpoch : number ;
actualEpoch : number ;
}
| {
status : "rejected" ;
epoch : number ;
issues : MutationIssue [];
}
| {
} Outcome of applying a document transaction, including conflict, rejection, and no-op states. API reference interface QueryRefreshOptions {
readonly signal?: AbortSignal;
} interface QueryRefreshOptions {
readonly signal ?: AbortSignal ;
} interface QueryRefreshOptions {
readonly signal ?: AbortSignal ;
} The signal cancels a pending refresh before it writes anything. API reference type QueryRefreshResult =
| {
readonly status: "applied";
readonly transaction: ApplyTransactionResult;
}
| {
readonly status: "failed";
readonly queryId: string;
readonly diagnostic: QueryDiagnostic;
}
| {
readonly status: "blocked";
readonly queryId: string;
readonly reason: QueryOutputBlock;
}
// … 7 more lines — see the API reference
} type QueryRefreshResult =
| {
readonly status : "applied" ;
readonly transaction : ApplyTransactionResult ;
}
| {
readonly status : "failed" ;
readonly queryId : string ;
readonly diagnostic : QueryDiagnostic ;
}
| {
readonly status : "blocked" ;
readonly queryId : string ;
readonly reason : QueryOutputBlock ;
}
} type QueryRefreshResult =
| {
readonly status : "applied" ;
readonly transaction : ApplyTransactionResult ;
}
| {
readonly status : "failed" ;
readonly queryId : string ;
readonly diagnostic : QueryDiagnostic ;
}
| {
readonly status : "blocked" ;
readonly queryId : string ;
readonly reason : QueryOutputBlock ;
}
| {
readonly status : "missing" ;
readonly queryId : string ;
}
} One refresh commits every requested output in one transaction, or none. API reference On this page