mirror of
https://github.com/johndoe6345789/postgres.git
synced 2026-04-29 16:25:01 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user