MCPcopy Create free account
hub / github.com/bytebase/bytebase / upsertDatabases

Function upsertDatabases

frontend/src/react/stores/app/database.ts:68–80  ·  view source on GitHub ↗
(
    databases: Database[]
  )

Source from the content-addressed store, hash-verified

66 // Compose then immutably merge into the by-name cache; returns the composed
67 // list so callers can hand it straight back to their consumers.
68 const upsertDatabases = async (
69 databases: Database[]
70 ): Promise<Database[]> => {
71 const composed = await composeDatabases(databases);
72 set((state) => {
73 const next = { ...state.databasesByName };
74 for (const db of composed) {
75 next[db.name] = db;
76 }
77 return { databasesByName: next };
78 });
79 return composed;
80 };
81
82 const fetchByName = async (
83 name: string,

Callers 1

createDatabaseSliceFunction · 0.85

Calls 2

composeDatabasesFunction · 0.85
setFunction · 0.85

Tested by

no test coverage detected