| 84 | */ |
| 85 | |
| 86 | const 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 |