(core) add grist.getTable(tableId) and a getTableId() method in plugin api

Summary:
Makes the new TableOperations API available for all tables
in the document. Adds methods for discovering the tableId of the
selected table. I was very tempted to implement the select() TODO
in the TableOperations API, but it requires a significant refactor
of the backend.

Test Plan: added test

Reviewers: alexmojaki

Reviewed By: alexmojaki

Differential Revision: https://phab.getgrist.com/D3325
This commit is contained in:
Paul Fitzpatrick
2022-03-16 14:33:48 -04:00
parent fa75f60bfd
commit a5f5ecce19
3 changed files with 41 additions and 12 deletions

View File

@@ -19,6 +19,9 @@ export interface TableOperations {
upsert(records: Types.AddOrUpdateRecord|Types.AddOrUpdateRecord[],
options?: UpsertOptions): Promise<void>;
// Determine the tableId of the table.
getTableId(): Promise<string>;
// TODO: offer a way to query the table.
// select(): Records;
}