MCPcopy
hub / github.com/spaceandtimefdn/SxT-NodeJS-SDK / DiscoveryUtil

Function DiscoveryUtil

examples/index.ts:86–109  ·  view source on GitHub ↗
(sxt: any)

Source from the content-addressed store, hash-verified

84 */
85
86const DiscoveryUtil = async (sxt: any): Promise<Boolean> => {
87 const discovery = sxt.DiscoveryAPI();
88
89 // List schemas
90 const schemas = await discovery.ListSchemas();
91 console.log(schemas);
92
93 // // List tables
94 const tables = await discovery.ListTables("PUBLIC", "ETHEREUM");
95
96 // List table columns
97 const columns = await discovery.ListColumns("ETHEREUM", "TRANSACTIONS");
98
99 // List table indexes
100 const indexes = await discovery.ListTableIndexes(
101 "ETHEREUM",
102 "TRANSACTIONS"
103 );
104
105 if (schemas?.error || tables?.error || columns?.error || indexes?.error) {
106 return false;
107 }
108 return true;
109};
110
111/**
112 * Example

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected