From 27f21d5cc45d724c62259d4005b038f8d0ee7668 Mon Sep 17 00:00:00 2001 From: Tara <39621793+Tara8573@users.noreply.github.com> Date: Fri, 11 Sep 2026 17:39:31 +0800 Subject: [PATCH] feat(structure): geometry subtype and srid editor for postgres --- .../structure/TableStructureEditor.vue | 39 ++++++++ .../ui/searchable-select/SearchableSelect.vue | 25 ++++- .../SearchableSelect.trigger.spec.ts | 70 +++++++++++++ apps/desktop/src/i18n/locales/az.ts | 4 + apps/desktop/src/i18n/locales/en.ts | 4 + apps/desktop/src/i18n/locales/es.ts | 4 + apps/desktop/src/i18n/locales/it.ts | 4 + apps/desktop/src/i18n/locales/ja.ts | 4 + apps/desktop/src/i18n/locales/ko.ts | 4 + apps/desktop/src/i18n/locales/pt-BR.ts | 4 + apps/desktop/src/i18n/locales/tr.ts | 4 + apps/desktop/src/i18n/locales/zh-CN.ts | 4 + apps/desktop/src/i18n/locales/zh-TW.ts | 4 + ...tableStructureEditorState.geometry.spec.ts | 98 +++++++++++++++++++ .../lib/table/tableStructureEditorState.ts | 60 ++++++++++++ 15 files changed, 329 insertions(+), 3 deletions(-) create mode 100644 apps/desktop/src/components/ui/searchable-select/__tests__/SearchableSelect.trigger.spec.ts create mode 100644 apps/desktop/src/lib/__tests__/table/tableStructureEditorState.geometry.spec.ts diff --git a/apps/desktop/src/components/structure/TableStructureEditor.vue b/apps/desktop/src/components/structure/TableStructureEditor.vue index 1a8e9c2c02..901d324ef6 100644 --- a/apps/desktop/src/components/structure/TableStructureEditor.vue +++ b/apps/desktop/src/components/structure/TableStructureEditor.vue @@ -76,6 +76,11 @@ import { generateUniqueIndexName, getColumnEditorControls, getDataTypeOptions, + POSTGRES_GEOMETRY_TYPES, + combinePostgresGeometryType, + isPostgresGeometryDataType, + postgresGeometrySridValue, + postgresGeometryTypeValue, getDataTypeLengthUnitOptions, getDefaultLengthForType, hasExistingColumnTypeChange, @@ -2796,6 +2801,11 @@ function updateColumnDataTypeLength(column: EditableStructureColumn, value: stri syncDamengIdentityForDataType(column); } +function updatePostgresGeometryColumn(column: EditableStructureColumn, geomType: string, srid: string) { + const baseType = dataTypeBaseInputValue(databaseType.value, column.dataType); + column.dataType = combinePostgresGeometryType(baseType, geomType, srid); +} + function updateColumnDataTypeLengthUnit(column: EditableStructureColumn, value: unknown) { const baseType = dataTypeBaseInputValue(databaseType.value, column.dataType); const unit = value === "__default" ? "" : String(value ?? ""); @@ -4453,6 +4463,35 @@ watch( +
+
+ + +
+

+ {{ t("structureEditor.geometryEmptyTypeHint") }} +

+