MCPcopy Index your code
hub / github.com/bytebase/bytebase / getDatabaseQueryContext

Function getDatabaseQueryContext

frontend/src/react/stores/sqlEditor/tab.ts:529–542  ·  view source on GitHub ↗
(
  database: string,
  contextId: string
)

Source from the content-addressed store, hash-verified

527 * without assuming it still lives in the active tab.
528 */
529export 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
544export const subscribeSQLEditorTabsState = (
545 listener: (state: SQLEditorTabsState) => void

Callers 1

useExecuteSQLFunction · 0.90

Calls 3

getSQLEditorTabsStateFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected