Skip to content

deparser printing ALTER TABLE ALTER COLUMN statement partially #43

@divyenduz

Description

@divyenduz

To reproduce:

const { parse, deparse } = require('pgsql-parser');

async function main() {
    const stmts = parse(`
    ALTER TABLE public.table1 ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY (
        SEQUENCE NAME public.table1
        START WITH 1
        INCREMENT BY 1
        NO MINVALUE
        NO MAXVALUE
        CACHE 1
    );
    `)
    console.log(stmts)
    const stmts2 = deparse(stmts[0])
    console.log(stmts2)
}

main()
yarn run v1.22.10
[ { RawStmt: { stmt: [Object], stmt_len: 266 } } ]
ALTER TABLE public.table1 ;
Done in 0.41s.

It should re-print the whole statement. Please let me know if any information is required from my side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions