Repository navigation
prettier-plugin-postgresql@0.3.3
·
253 commits
to main
since this release
Patch Changes
- c91f89f: Keep the
COLLATEclause ofALTER COLUMN ... TYPE, instead of silently dropping it. - b2820c7: Keep the OID of
ALTER LARGE OBJECT, theADD USER/DROP USERmember list ofALTER GROUP, andOWNER TO current_user(and the other role keywords), instead of printing a statement that means something else. - 40eb725: Format the remaining
ALTER TABLE/ALTER INDEX/ALTER VIEW/ALTER MATERIALIZED VIEW/ALTER FOREIGN TABLE/ALTER SEQUENCEsubcommands:OWNER TO,SET TABLESPACE,SET (...)/RESET (...), identity (ADD GENERATED,SET GENERATED,RESTART,DROP IDENTITY),DROP EXPRESSION,SET EXPRESSION,SET STATISTICS,SET STORAGE,SET COMPRESSION,VALIDATE/ALTER CONSTRAINT, trigger and rule enable/disable, row level security,CLUSTER ON,SET LOGGED/UNLOGGED,INHERIT,OF,REPLICA IDENTITY,ATTACH/DETACH PARTITION, and foreign tableOPTIONS. These used to make the formatter fail. A partition bound value it cannot print now fails loudly instead of being dropped. - 7516b64: Keep the subscripts and field names of INSERT and UPDATE targets (
set a[1] = 2,insert into t (a.b)), theUNLOGGEDofSELECT ... INTO UNLOGGED, andOVERRIDING ... VALUEinMERGE ... INSERT, instead of silently dropping them. - b239857: Lay out
AND/ORoutside WHERE/HAVING-style clauses on one line when it fits (select lists,JOIN ... ON,CASE, function arguments, CHECK, policies, triggers), hanging indented otherwise, instead of starting each operand at column 0. ParenthesisedAND/ORgroups stay on one line when short. - 9752bcb: Indent
ELSEin aCASEexpression to line up with itsWHENbranches, as the T-SQL plugin does. - 8ac17f4: Print the real syntax for
COMMENT ONconstraint, trigger, rule, policy, domain constraint, operator class / family, transform and cast targets, and keep the OID ofCOMMENT ON LARGE OBJECT. - 1288baf: Keep the objects created inside
CREATE SCHEMA ... CREATE TABLE ... CREATE VIEW ..., instead of dropping them. - 12c7fca: Keep the
OF typeandWITH OPTIONSof typed tables, theSTORAGEandCOMPRESSIONcolumn clauses, andIF NOT EXISTSonCREATE FOREIGN TABLE, instead of silently dropping them. - 84925e0: Format
DEFAULTinVALUESandSET, multi-column assignment (SET (a, b) = (1, 2),= (SELECT ...)),expr COLLATE "C",WHERE CURRENT OF cursor,merge_action()and bit-string literals (B'101',X'ff'), which used to make the formatter fail. - 3dccb55: Format
CREATE FUNCTION ... TRANSFORM FOR TYPE ...andCREATE TABLE ... AS EXECUTE ..., which used to make the formatter fail. - 0e6f783: Print every GRANT / REVOKE object type correctly:
FOREIGN SERVER,TYPE,DOMAIN,LARGE OBJECT,PARAMETER,ALL PROCEDURES IN SCHEMAand the rest, instead of an internal name or a missing object name. - f90ac46: Print
expr IS DOCUMENTas a postfix predicate instead of the invalidis document(expr). - 63316c0: Keep the options, option values and target of
CLUSTER,REINDEX,VACUUMandANALYZE:cluster verbose,cluster (verbose) t using i,reindex schema s,reindex database d,reindex system d,reindex (tablespace ts), and the case of quoted option values. - c080785: Keep the whole
PARTITION BYelement (((lower(a))),COLLATE, operator class),PARTITION OFwith its columns, storage andIF NOT EXISTS/UNLOGGED, foreign tables'PARTITION OFandINHERITSand columnOPTIONSbefore constraints, andCREATE [OR REPLACE] AGGREGATEarguments (ORDER BY,*,VARIADIC, argument names).DROP/ALTER/COMMENT ON AGGREGATE a(*)keep their*. - 607882c: Keep argument modes and names in function and aggregate signatures of
DROP,ALTER,COMMENTandGRANT(DROP FUNCTION f(IN a int, OUT b text),DROP PROCEDURE p(INOUT x int),VARIADIC), which were reduced to bare input types. - 0fe7f52: Print
SECURITY LABEL ONdomain, type, function, large object and other targets correctly instead of an internal object-type name. - 1d8536d: Keep the interval of
SET TIME ZONE INTERVAL '1' HOUR TO MINUTEinstead of turning it into the plain string'1'. - c4b1484: Format SQL-standard function bodies (
CREATE FUNCTION ... RETURN expr,BEGIN ATOMIC ... ENDfor functions and procedures), expressions in partition bounds (FOR VALUES FROM (date '2020-01-01') TO (...),IN (1 + 1)) andGENERATED ... AS IDENTITY (SEQUENCE NAME s), which used to make the formatter fail. - c4b1484: Format the rest of the SQL/JSON syntax, which used to make the formatter fail:
x IS [NOT] JSON [VALUE | ARRAY | OBJECT | SCALAR] [WITH UNIQUE KEYS],JSON_SCALAR,JSON_SERIALIZE,JSON(...)andJSON_ARRAY(SELECT ...).XMLTABLE(XMLNAMESPACES(...), ...)and the column list of anXMLTABLE/JSON_TABLEalias (AS t(a, b)) were silently dropped and are kept now. - 15e4822: Print
(a, b) OVERLAPS (c, d),x IS [NOT] [NFC] NORMALIZED,NORMALIZE(x, NFC),SYSTEM_USER,COLLATION FOR (x)andXMLEXISTS(path PASSING doc)as SQL syntax instead of thepg_catalogfunction call they parse to, which meant something else. - 1bd3331: Keep
VARIADICin function calls (f(VARIADIC arr)), operator-valued options (commutator = ===,sortop = <) and numeric options ofCREATE AGGREGATE/OPERATOR/TYPE,t.a%TYPEin function signatures, and the comments of a script that has no statements; these were silently dropped. An option value of a kind the formatter cannot print now raises an error instead of vanishing.