MCPcopy
hub / github.com/chartdb/chartdb / getTableIndexesWithPrimaryKey

Function getTableIndexesWithPrimaryKey

src/lib/domain/db-index.ts:142–154  ·  view source on GitHub ↗
({
    table,
}: {
    table: DBTable;
})

Source from the content-addressed store, hash-verified

140};
141
142export const getTableIndexesWithPrimaryKey = ({
143 table,
144}: {
145 table: DBTable;
146}): DBIndex[] => {
147 const primaryKeyIndex = getTablePrimaryKeyIndex({ table });
148 const indexesWithoutPKIndex = table.indexes.filter(
149 (idx) => !idx.isPrimaryKey
150 );
151 return primaryKeyIndex
152 ? [primaryKeyIndex, ...indexesWithoutPKIndex]
153 : indexesWithoutPKIndex;
154};

Callers 5

loadFromDatabaseMetadataFunction · 0.90
sqlImportToDiagramFunction · 0.90
importDBMLToDiagramFunction · 0.90
ChartDBProviderFunction · 0.90
updateTableFnFunction · 0.90

Calls 1

getTablePrimaryKeyIndexFunction · 0.85

Tested by

no test coverage detected