MCPcopy Create free account
hub / github.com/apitable/apitable / getDatasheet

Method getDatasheet

packages/core/src/databus/logic/database.ts:60–76  ·  view source on GitHub ↗

* Load a datasheet in the database. * * **NOTE**: A data storage provider and a store provider must be set before loading datasheets.

(dstId: string, options: IDatasheetOptions)

Source from the content-addressed store, hash-verified

58 * **NOTE**: A data storage provider and a store provider must be set before loading datasheets.
59 */
60 async getDatasheet(dstId: string, options: IDatasheetOptions): Promise<Datasheet | null> {
61 const { loadOptions } = options;
62 const datasheetPack = await this.storageProvider.loadDatasheetPack(dstId, loadOptions);
63 if (datasheetPack === null) {
64 return null;
65 }
66 const store =
67 'createStore' in options
68 ? await options.createStore(datasheetPack)
69 : await this.storeProvider.createDatasheetStore(datasheetPack, options.storeOptions);
70 const datasheet = new Datasheet(dstId, {
71 store,
72 saver: this.storageProvider,
73 commandManager: this.getCommandManager(store),
74 });
75 return datasheet;
76 }
77
78 async getDashboard(dsbId: string, options: IDashboardOptions): Promise<Dashboard | null> {
79 const { loadOptions } = options;

Callers 15

record.test.tsFile · 0.45
field.test.tsFile · 0.45
databus.test.tsFile · 0.45
dashboard.test.tsFile · 0.45
view.test.tsFile · 0.45
database.test.tsFile · 0.45
datasheet.test.tsFile · 0.45
loadDatasheetFunction · 0.45
linkLookUpFieldFunction · 0.45
useFetchExtraDataFunction · 0.45
checkForeignDatasheetMethod · 0.45

Calls 3

getCommandManagerMethod · 0.95
loadDatasheetPackMethod · 0.65
createDatasheetStoreMethod · 0.65

Tested by

no test coverage detected