-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Description
Hello team!
I can’t get a clean output from desparse. Please take a look at these two code snippets. One of them produces timestamp(2) with time zone. Perfect! The other gives pg_catalog.timestamp(2), and that’s depressing. I’d like the second case to output either timestamp(2) with time zone or just timestamp(2), but not what it does now.
import { parse, deparse } from 'pgsql-parser'; // 17.7.8
const parsed = await parse(`
CREATE TABLE public."ACTIVITY" (
"ACTIVITY_ID" bigint NOT NULL,
"PUBLISHED" timestamp(2) with time zone
)
`);
const desparsed = await deparse(parsed);
console.log(desparsed);
// CREATE TABLE public."ACTIVITY" ("ACTIVITY_ID" bigint NOT NULL, "PUBLISHED" timestamp(2) with time zone)import { parse, deparse } from 'pgsql-parser'; // 17.7.8
const parsed = await parse(`
CREATE TABLE public."ACTIVITY" (
"ACTIVITY_ID" bigint NOT NULL,
"PUBLISHED" timestamp(2)
)
`);
const desparsed = await deparse(parsed);
console.log(desparsed);
// CREATE TABLE public."ACTIVITY" ("ACTIVITY_ID" bigint NOT NULL, "PUBLISHED" pg_catalog.timestamp(2))Can’t figure out why the code is written this way. And where are timestamp and time?
The same goes for the pg_catalog.text :-(
Metadata
Metadata
Assignees
Labels
No labels