Skip to content

[codex] Support PostgreSQL index types in DBML parser#98

Draft
TheTrustedAdvisor wants to merge 1 commit into
BOCOVO:mainfrom
TheTrustedAdvisor:codex/postgis-index-types
Draft

[codex] Support PostgreSQL index types in DBML parser#98
TheTrustedAdvisor wants to merge 1 commit into
BOCOVO:mainfrom
TheTrustedAdvisor:codex/postgis-index-types

Conversation

@TheTrustedAdvisor

Copy link
Copy Markdown

Summary

Adds a compatibility layer for DBML indexes that use PostgreSQL index methods currently rejected by @dbml/core, such as gist, gin, brin, and spgist.

Details

@dbml/core rejects DBML index settings like geom_lv95 [type: gist] before this package can transform the parsed schema. The parser currently accepts only btree and hash; this behavior is still present in @dbml/core@8.2.5.

This change normalizes unsupported PostgreSQL index methods to a parser-supported type only inside indexes { ... } blocks, parses the schema, then restores the original index methods on the parsed indexes before validation and transformation.

Validation

  • corepack yarn workspace dbml-to-json-table-schema test --runInBand
  • Pre-commit hook: lint-staged, including tsc-files --noEmit, eslint --fix, and prettier --write

Notes

A true upstream fix would be to extend the @dbml/core DBML grammar to accept these PostgreSQL index methods directly. Until then, this keeps the workaround local and narrowly scoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant