@dbml/core 12.0.0 Postgres importer: timestamptz becomes timestamp, schema-qualified type doubled, Ref with ?<? rejected by parser

Aperta
#1,042 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@zzoraemon043 ci sta già lavorando.

Dal 17/11/2026.

  • #1043 di @zzoraemon043 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, postgresql
Ambito
backend, databases

Direzione di ricerca

Start by tracing the Postgres importer used by importer.import(sql, 'postgres'), then inspect the DBML parser path that rejects its output. Reproduce the three cases in the issue: timestamptz, schema-qualified extensions.citext, and the foreign key reference. Done means the importer preserves the type detail and emits DBML the parser accepts with the expected reference direction.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The Postgres importer in @dbml/core 12.0.0 produces DBML that its own parser rejects, and it loses a type detail. Same result with @dbml/cli 12.0.0 (sql2dbml). Node 26.13.1.

Repro:

const { importer, Parser } = require('@dbml/core');
const sql = `CREATE TABLE a (id uuid PRIMARY KEY, at timestamp with time zone NOT NULL, email extensions.citext);
CREATE TABLE b (id uuid PRIMARY KEY, a_id uuid REFERENCES a(id));`;
const out = importer.import(sql, 'postgres');
new Parser().parse(out, 'dbml');

Output:

Table "a" {
  "id" uuid [pk]
  "at" timestamp [not null]
  "email" extensions.extensions.citext
}
...
Ref:"a"."id" ?<? "b"."a_id"
  1. timestamp with time zone is written as timestamp, so the time zone is lost.
  2. A schema-qualified type extensions.citext is written as extensions.extensions.citext. The parser rejects it: Expected " ", comment, or newline but "." found.
  3. The foreign key is written as Ref:"a"."id" ?<? "b"."a_id". With the citext column removed, the parser rejects it: Expected " " or <>, >, - or < but "?" found.

Expected: timestamptz (or timestamp with time zone), extensions.citext, and Ref: "b"."a_id" > "a"."id".

Lingua principale
JavaScript
Stelle
3.7k
Fork
233
Merge medio
2g 4h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di holistics/dbml

Tutte le issue di holistics/dbml

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.