( database: string, contextId: string )
| 527 | * without assuming it still lives in the active tab. |
| 528 | */ |
| 529 | export const getDatabaseQueryContext = ( |
| 530 | database: string, |
| 531 | contextId: string |
| 532 | ): SQLEditorDatabaseQueryContext | undefined => { |
| 533 | const owner = locateDatabaseQueryContext( |
| 534 | getSQLEditorTabsState().tabsById, |
| 535 | database, |
| 536 | contextId |
| 537 | ); |
| 538 | if (!owner) return undefined; |
| 539 | return getSQLEditorTabsState() |
| 540 | .tabsById.get(owner.tabId) |
| 541 | ?.databaseQueryContexts?.get(database)?.[owner.index]; |
| 542 | }; |
| 543 | |
| 544 | export const subscribeSQLEditorTabsState = ( |
| 545 | listener: (state: SQLEditorTabsState) => void |
no test coverage detected