feat: add index type, included columns, filter, and comment support
- Add filter, index_type, included_columns, and comment fields to IndexInfo - PostgreSQL: query pg_am for index type, use indnkeyatts to split key/included columns, retrieve index comments via obj_description() - SQL Server: add type_desc, filter_definition, included columns via is_included_column - MySQL: add INDEX_TYPE from information_schema.STATISTICS - Oracle: add INDEX_TYPE from ALL_INDEXES - DDL generation: add USING (PostgreSQL), type prefix + INCLUDE + WHERE (SQL Server), COMMENT ON INDEX (PostgreSQL) - Frontend: update types, state mapping, SQL generation, and i18n translations
This commit is contained in:
@@ -27,6 +27,10 @@ function index(overrides: Partial<EditableStructureIndex>): EditableStructureInd
|
||||
columns: overrides.columns ?? ["name"],
|
||||
isUnique: overrides.isUnique ?? false,
|
||||
isPrimary: overrides.isPrimary ?? false,
|
||||
filter: overrides.filter ?? "",
|
||||
indexType: overrides.indexType ?? "",
|
||||
includedColumns: overrides.includedColumns ?? [],
|
||||
comment: overrides.comment ?? "",
|
||||
original: overrides.original,
|
||||
markedForDrop: overrides.markedForDrop ?? false,
|
||||
};
|
||||
|
||||
@@ -3,7 +3,6 @@ import test from "node:test";
|
||||
import {
|
||||
createColumnDrafts,
|
||||
createIndexDrafts,
|
||||
splitIndexColumns,
|
||||
toColumnNames,
|
||||
} from "../src/lib/tableStructureEditorState.ts";
|
||||
import type { ColumnInfo, IndexInfo } from "../src/types/database.ts";
|
||||
@@ -101,6 +100,5 @@ test("creates editable index drafts and splits pasted column lists", () => {
|
||||
originalName: "idx_name",
|
||||
},
|
||||
]);
|
||||
assert.deepEqual(splitIndexColumns("id, name email"), ["id", "name", "email"]);
|
||||
assert.equal(toColumnNames(["id", "name"]), "id, name");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user