feat: Add index management feature with API and UI

- Add index-management feature to features.json
- Create /api/admin/indexes endpoint (GET, POST, DELETE)
- Build IndexManagerTab component for managing indexes
- Add support for BTREE, HASH, GIN, GIST, BRIN index types
- Add unique index creation option
- Add multi-column index support
- Create comprehensive integration tests (30+ tests)
- Add getIndexTypes utility function
- Update navigation to include Index Manager
- Add SQL injection prevention for all operations

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-08 12:56:03 +00:00
parent 921b528977
commit 6707f25e14
5 changed files with 1012 additions and 0 deletions

View File

@@ -45,6 +45,12 @@ export type QueryOperator = {
label: string;
};
export type IndexType = {
value: string;
label: string;
description: string;
};
// Type definition for the features config structure
type FeaturesConfig = {
features: Feature[];
@@ -52,6 +58,7 @@ type FeaturesConfig = {
constraintTypes?: ConstraintType[];
navItems: NavItem[];
queryOperators?: QueryOperator[];
indexTypes?: IndexType[];
};
const config = featuresConfig as FeaturesConfig;
@@ -76,6 +83,10 @@ export function getQueryOperators(): QueryOperator[] {
return config.queryOperators || [];
}
export function getIndexTypes(): IndexType[] {
return config.indexTypes || [];
}
export function getNavItems(): NavItem[] {
return config.navItems.filter((item) => {
const feature = getFeatureById(item.featureId);