Repository navigation
Expand file tree
/
Copy pathpackage.json
More file actions
937 lines (933 loc) · 41.9 KB
/
Copy pathpackage.json
File metadata and controls
937 lines (933 loc) · 41.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
{
"name": "postgres-query-booster",
"displayName": "PostgreSQL Query Booster",
"description": "A VS Code extension for browsing, editing, and managing PostgreSQL databases",
"version": "3.4.0",
"publisher": "sirlychee",
"license": "MIT",
"icon": "images/icon.png",
"repository": {
"type": "git",
"url": "https://github.com/MegaCoolBlood/PostgresQueryBuilder.git"
},
"bugs": {
"url": "https://github.com/MegaCoolBlood/PostgresQueryBuilder/issues"
},
"engines": {
"vscode": "^1.85.0",
"node": ">=18"
},
"bin": {
"pgformat": "./dist/cli.js"
},
"categories": [
"Formatters",
"Programming Languages",
"Data Science",
"Other"
],
"keywords": [
"postgres",
"postgresql",
"sql",
"plpgsql",
"database"
],
"activationEvents": [
"onStartupFinished"
],
"main": "./dist/extension.js",
"contributes": {
"viewsContainers": {
"activitybar": [
{
"id": "postgresQueryBuilderExplorer",
"title": "PostgreSQL Query Booster",
"icon": "images/postgres_underworld_crown_mono.svg"
}
]
},
"views": {
"postgresQueryBuilderExplorer": [
{
"id": "postgresTableExplorer",
"name": "Tables",
"icon": "$(table)"
},
{
"id": "postgresTableSearch",
"name": "Search",
"type": "webview",
"icon": "$(search)"
},
{
"id": "postgresModifyHistory",
"name": "Modify History",
"type": "webview",
"icon": "$(history)"
},
{
"id": "postgresSavedQueries",
"name": "Bookmarked Queries",
"icon": "$(bookmark)"
}
]
},
"commands": [
{
"command": "postgresQueryBuilder.connect",
"title": "New Connection",
"category": "PostgreSQL Query Booster",
"icon": "$(add)"
},
{
"command": "postgresQueryBuilder.disconnect",
"title": "Disconnect",
"category": "PostgreSQL Query Booster",
"icon": "$(plug)"
},
{
"command": "postgresQueryBuilder.refreshExplorer",
"title": "Refresh Table Explorer",
"category": "PostgreSQL Query Booster",
"icon": "$(refresh)"
},
{
"command": "postgresQueryBuilder.editSearchPath",
"title": "Show / Edit search_path",
"category": "PostgreSQL Query Booster",
"icon": "$(list-tree)"
},
{
"command": "postgresQueryBuilder.openTable",
"title": "Open Table",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.selectConnection",
"title": "Select Connection",
"category": "PostgreSQL Query Booster",
"icon": "$(database)"
},
{
"command": "postgresQueryBuilder.openSqlEditor",
"title": "Open SQL Editor",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.exportCustomMappings",
"title": "Export Custom Column Mappings...",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.importCustomMappings",
"title": "Import Custom Column Mappings...",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.openCustomMappingsFile",
"title": "Open Workspace Custom Mappings File",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.manageCustomMappings",
"title": "Manage Custom Column Mappings...",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.openPsqlConsole",
"title": "Open psql Console",
"category": "PostgreSQL Query Booster",
"icon": "$(terminal)"
},
{
"command": "postgresQueryBuilder.viewDataFromSelect",
"title": "View Data",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.executeStatement",
"title": "Execute Selection",
"category": "PostgreSQL Query Booster",
"icon": "$(play)"
},
{
"command": "postgresQueryBuilder.resetSqlFileSession",
"title": "Reset Database Session",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.executeFile",
"title": "Execute File",
"category": "PostgreSQL Query Booster",
"icon": "$(run-all)"
},
{
"command": "postgresQueryBuilder.formatSql",
"title": "Format PL/pgSQL",
"category": "PostgreSQL Query Booster",
"icon": "$(symbol-namespace)"
},
{
"command": "postgresQueryBuilder.exportFormatConfig",
"title": "Export Formatter Settings to .pgformat.json",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.runSavedQuery",
"title": "Run Bookmarked Query...",
"category": "PostgreSQL Query Booster",
"icon": "$(play)"
},
{
"command": "postgresQueryBuilder.refreshSavedQueries",
"title": "Refresh Bookmarked Queries",
"category": "PostgreSQL Query Booster",
"icon": "$(refresh)"
},
{
"command": "postgresQueryBuilder.renameSavedQuery",
"title": "Rename Bookmarked Query...",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.editSavedQuerySql",
"title": "Edit Bookmarked Query SQL...",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.editSavedQuery",
"title": "Edit Bookmarked Query...",
"category": "PostgreSQL Query Booster",
"icon": "$(edit)"
},
{
"command": "postgresQueryBuilder.duplicateSavedQuery",
"title": "Duplicate Bookmarked Query",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.deleteSavedQuery",
"title": "Delete Bookmarked Query",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.moveSavedQueryToWorkspace",
"title": "Move Bookmarked Query to Workspace",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.moveSavedQueryToGlobal",
"title": "Move Bookmarked Query to Personal",
"category": "PostgreSQL Query Booster"
},
{
"command": "postgresQueryBuilder.openSavedQueriesFile",
"title": "Open Workspace Bookmarked Queries File",
"category": "PostgreSQL Query Booster",
"icon": "$(go-to-file)"
},
{
"command": "postgresQueryBuilder.manageSavedQueries",
"title": "Manage Bookmarked Queries...",
"category": "PostgreSQL Query Booster",
"icon": "$(gear)"
},
{
"command": "postgresQueryBuilder.saveQueryFromEditor",
"title": "Bookmark Query...",
"category": "PostgreSQL Query Booster",
"icon": "$(add)"
}
],
"menus": {
"view/title": [
{
"command": "postgresQueryBuilder.selectConnection",
"when": "view == postgresTableExplorer",
"group": "navigation@1"
},
{
"command": "postgresQueryBuilder.connect",
"when": "view == postgresTableExplorer",
"group": "navigation@2"
},
{
"command": "postgresQueryBuilder.disconnect",
"when": "view == postgresTableExplorer",
"group": "navigation@3"
},
{
"command": "postgresQueryBuilder.editSearchPath",
"when": "view == postgresTableExplorer",
"group": "navigation@4"
},
{
"command": "postgresQueryBuilder.refreshExplorer",
"when": "view == postgresTableExplorer",
"group": "navigation@5"
},
{
"command": "postgresQueryBuilder.saveQueryFromEditor",
"when": "view == postgresSavedQueries",
"group": "navigation"
},
{
"command": "postgresQueryBuilder.refreshSavedQueries",
"when": "view == postgresSavedQueries",
"group": "navigation"
},
{
"command": "postgresQueryBuilder.openSavedQueriesFile",
"when": "view == postgresSavedQueries",
"group": "navigation"
},
{
"command": "postgresQueryBuilder.manageSavedQueries",
"when": "view == postgresSavedQueries",
"group": "navigation"
}
],
"view/item/context": [
{
"command": "postgresQueryBuilder.runSavedQuery",
"when": "view == postgresSavedQueries && viewItem =~ /^savedQuery\\./",
"group": "inline"
},
{
"command": "postgresQueryBuilder.editSavedQuery",
"when": "view == postgresSavedQueries && viewItem =~ /^savedQuery\\./",
"group": "1_modify@0"
},
{
"command": "postgresQueryBuilder.renameSavedQuery",
"when": "view == postgresSavedQueries && viewItem =~ /^savedQuery\\./",
"group": "1_modify@1"
},
{
"command": "postgresQueryBuilder.editSavedQuerySql",
"when": "view == postgresSavedQueries && viewItem =~ /^savedQuery\\./",
"group": "1_modify@2"
},
{
"command": "postgresQueryBuilder.duplicateSavedQuery",
"when": "view == postgresSavedQueries && viewItem =~ /^savedQuery\\./",
"group": "1_modify@3"
},
{
"command": "postgresQueryBuilder.moveSavedQueryToWorkspace",
"when": "view == postgresSavedQueries && viewItem == savedQuery.global",
"group": "2_scope@1"
},
{
"command": "postgresQueryBuilder.moveSavedQueryToGlobal",
"when": "view == postgresSavedQueries && viewItem == savedQuery.workspace",
"group": "2_scope@2"
},
{
"command": "postgresQueryBuilder.deleteSavedQuery",
"when": "view == postgresSavedQueries && viewItem =~ /^savedQuery\\./",
"group": "3_delete@1"
}
],
"editor/title": [
{
"command": "postgresQueryBuilder.executeFile",
"when": "resourceLangId == sql",
"group": "navigation"
}
],
"editor/context": [
{
"command": "postgresQueryBuilder.executeStatement",
"when": "editorTextFocus && editorHasSelection && resourceLangId == sql",
"group": "navigation@7"
},
{
"command": "postgresQueryBuilder.executeFile",
"when": "editorTextFocus && resourceLangId == sql",
"group": "navigation@8"
},
{
"command": "postgresQueryBuilder.viewDataFromSelect",
"when": "editorTextFocus && resourceLangId == sql",
"group": "navigation@9"
},
{
"command": "postgresQueryBuilder.saveQueryFromEditor",
"when": "editorTextFocus && (resourceLangId == sql || resourceLangId == postgres || resourceLangId == pgsql)",
"group": "navigation@10"
},
{
"command": "postgresQueryBuilder.resetSqlFileSession",
"when": "editorTextFocus && resourceLangId == sql",
"group": "navigation@11"
},
{
"command": "postgresQueryBuilder.formatSql",
"when": "editorTextFocus && (resourceLangId == sql || resourceLangId == postgres || resourceLangId == pgsql)",
"group": "1_modification@10"
}
]
},
"keybindings": [
{
"command": "postgresQueryBuilder.executeStatement",
"key": "ctrl+alt+enter",
"mac": "cmd+alt+enter",
"when": "editorTextFocus && editorLangId == sql"
},
{
"command": "postgresQueryBuilder.executeFile",
"key": "ctrl+shift+alt+enter",
"mac": "cmd+shift+alt+enter",
"when": "editorTextFocus && editorLangId == sql"
}
],
"viewsWelcome": [
{
"view": "postgresTableExplorer",
"contents": "No active PostgreSQL connection.\n[$(database) Select Connection](command:postgresQueryBuilder.selectConnection)\n[$(add) New Connection](command:postgresQueryBuilder.connect)"
},
{
"view": "postgresSavedQueries",
"contents": "No bookmarked queries yet.\nRun a query in the Data Viewer and use \"Bookmark Query\" to store it here. Placeholders written as :name are filled in every time the query runs."
}
],
"configuration": [
{
"title": "Connections",
"order": 1,
"properties": {
"postgresQueryBuilder.defaultHost": {
"type": "string",
"default": "localhost",
"description": "Default host for new connections"
},
"postgresQueryBuilder.defaultPort": {
"type": "number",
"default": 5432,
"description": "Default port for new connections"
},
"postgresQueryBuilder.defaultDatabase": {
"type": "string",
"default": "postgres",
"description": "Default database name for new connections"
},
"postgresQueryBuilder.savedConnections": {
"type": "array",
"default": [],
"scope": "application",
"description": "Saved connection configurations (passwords stored in SecretStorage). Optional per connection: sslMode (disable, prefer, require, verify-full; prefer when missing) and caFile (PEM file used by verify-full)."
},
"postgresQueryBuilder.psqlPath": {
"type": "string",
"default": "",
"scope": "machine",
"markdownDescription": "Path to the `psql` executable (or the folder containing it) used by **Open psql Console**. Leave empty to search `PATH` and, on Windows, the default `Program Files\\PostgreSQL\\<version>\\bin` folders (newest version first)."
}
}
},
{
"title": "SQL & Data Viewer",
"order": 2,
"properties": {
"postgresQueryBuilder.alwaysQualifySchema": {
"type": "boolean",
"default": false,
"description": "Always include schema in generated SELECT table references"
},
"postgresQueryBuilder.alwaysQuote": {
"type": "boolean",
"default": false,
"description": "Always quote identifiers in generated SELECT statements"
},
"postgresQueryBuilder.completion.enable": {
"type": "boolean",
"default": true,
"markdownDescription": "Autocomplete in SQL files: tables, views, columns with their types, aliases, schemas, built-in functions and keywords of the active connection — the same suggestions as the query bar of the Data Viewer. Turn it off if another SQL extension already completes your files."
},
"postgresQueryBuilder.completion.tableAlias": {
"type": "boolean",
"default": true,
"markdownDescription": "When the autocomplete completes a table after `FROM` or `JOIN` — in SQL files and in the query bar of the Data Viewer — write its alias after it (`orders o`). The alias is the one chosen for the table when dragging it into an editor, otherwise the part of its first column before the underscore (`mtd_id` → `mtd`), numbered if the statement already uses it. No alias is written where the table already has one, or where the rule would only repeat the table name."
},
"postgresQueryBuilder.qualifyColumnsWithAlias": {
"type": "boolean",
"default": false,
"description": "When opening a table in the Data Viewer, qualify every column of the default SELECT with a table alias, reusing the same alias system as the drag-to-editor Select statement (a persisted per-table alias if set, otherwise one derived from the first column name)."
},
"postgresQueryBuilder.thousandSeparator": {
"type": "string",
"default": " ",
"enum": [
" ",
"\u00a0",
".",
"'",
""
],
"enumDescriptions": [
"Space: 9 999 999,99",
"Non-breaking space: 9 999 999,99",
"Dot: 9.999.999,99",
"Apostrophe: 9'999'999,99",
"No separator: 9999999,99"
],
"description": "Thousand separator for displaying numbers. The decimal mark is always a comma, so a comma cannot be used as thousand separator."
},
"postgresQueryBuilder.duplicateRowResetDefaults": {
"type": "string",
"enum": [
"volatile",
"all",
"none"
],
"enumDescriptions": [
"Reset identity and generated columns, defaults that call a function such as now() or nextval(), and the context keywords CURRENT_DATE and CURRENT_USER",
"Reset every column that has a default, including constant ones",
"Copy all values, including generated ones"
],
"default": "volatile",
"description": "Which columns are left to their database default when a row is duplicated"
}
}
},
{
"title": "Workspace Sharing",
"order": 3,
"properties": {
"postgresQueryBuilder.customMappingsFile": {
"type": "string",
"default": "postgres-query-builder.mappings.json",
"description": "Workspace-relative path to the JSON file used to share custom column mappings via git. Mappings stored here are visible to everyone who opens the workspace; personal mappings remain in VS Code global state."
},
"postgresQueryBuilder.savedQueriesFile": {
"type": "string",
"default": "postgres-query-builder.queries.json",
"description": "Workspace-relative path to the JSON file used to share bookmarked queries via git. Queries stored here are visible to everyone who opens the workspace; personal queries remain in VS Code global state."
},
"postgresQueryBuilder.newBookmarksToWorkspace": {
"type": "boolean",
"default": false,
"description": "Share a newly created bookmarked query with the workspace by default (commit to git) instead of keeping it personal. Falls back to personal when no workspace folder is open. The scope can still be changed in the bookmark dialog."
},
"postgresQueryBuilder.newMappingsToWorkspace": {
"type": "boolean",
"default": false,
"description": "Share a newly created custom column mapping with the workspace by default (commit to git) instead of keeping it personal. Falls back to personal when no workspace folder is open. The scope can still be changed in the mapping dialog."
}
}
},
{
"title": "Formatter",
"order": 4,
"properties": {
"postgresQueryBuilder.format.enable": {
"type": "boolean",
"default": true,
"description": "Enable the PL/pgSQL formatter (document formatting provider, command and SQL Editor button)."
},
"postgresQueryBuilder.format.configPath": {
"type": "string",
"default": "",
"description": "Path to the JSON file with formatter rules (same schema as .pgformat.json). An absolute path is used as-is; a relative path is resolved against the workspace root. Leave empty to use .pgformat.json in the workspace root."
},
"postgresQueryBuilder.format.formatOnSave": {
"type": "boolean",
"default": false,
"description": "Automatically format SQL/PL/pgSQL files with this extension when they are saved."
},
"postgresQueryBuilder.format.keywordCase": {
"type": "string",
"enum": [
"upper",
"lower",
"preserve"
],
"default": "upper",
"description": "Letter case applied to SQL/PL keywords (SELECT, BEGIN, IF, ...)."
},
"postgresQueryBuilder.format.identifierCase": {
"type": "string",
"enum": [
"preserve",
"lower",
"upper"
],
"default": "preserve",
"description": "Letter case applied to identifiers (table, column and variable names)."
},
"postgresQueryBuilder.format.dataTypeCase": {
"type": "string",
"enum": [
"upper",
"lower",
"preserve"
],
"default": "upper",
"description": "Letter case applied to data type names (integer, varchar, timestamp, ...)."
},
"postgresQueryBuilder.format.indentStyle": {
"type": "string",
"enum": [
"space",
"tab"
],
"default": "space",
"description": "Indentation character used by the formatter."
},
"postgresQueryBuilder.format.indentSize": {
"type": "number",
"default": 2,
"description": "Number of spaces per indentation level (ignored when indentStyle is 'tab')."
},
"postgresQueryBuilder.format.commaStyle": {
"type": "string",
"enum": [
"trailing",
"leading"
],
"default": "trailing",
"description": "Comma placement in multi-line column lists: at the end of the line (trailing) or the start of the next line (leading)."
},
"postgresQueryBuilder.format.blankLines": {
"type": "string",
"enum": [
"preserve",
"collapse"
],
"default": "preserve",
"enumDescriptions": [
"Keep authored blank lines exactly as written (1:1).",
"Collapse runs of blank lines down to a single blank line."
],
"description": "How the formatter handles authored blank lines between statements."
},
"postgresQueryBuilder.format.simpleSelectSingleLine": {
"type": "boolean",
"default": true,
"description": "Keep a simple SELECT (single column, at most one table, at most one WHERE condition, no JOIN/GROUP/ORDER) on a single line."
},
"postgresQueryBuilder.format.preserveSingleLineRoutineHeaders": {
"type": "boolean",
"default": true,
"description": "Keep a one-line CREATE FUNCTION/PROCEDURE header on one line."
},
"postgresQueryBuilder.format.preserveSingleLineIfBlocks": {
"type": "boolean",
"default": true,
"description": "Keep a fully one-line simple IF ... THEN ... END IF block on one line."
},
"postgresQueryBuilder.format.alignDeclarationTypes": {
"type": "boolean",
"default": false,
"description": "In a DECLARE section, align the type column of consecutive variable declarations by padding the variable names. Declarations separated by a blank line are aligned as independent groups."
},
"postgresQueryBuilder.format.alignSingleLineFunctions": {
"type": "boolean",
"default": false,
"description": "Align consecutive single-line CREATE FUNCTION statements at their RETURNS, LANGUAGE and AS clauses so the return type, volatility and body line up. Statements separated by a blank line are aligned as independent groups."
},
"postgresQueryBuilder.format.alignCaseWhenThen": {
"type": "boolean",
"default": false,
"description": "Align the THEN of consecutive single-line WHEN ... THEN ... branches in a CASE by padding the WHEN conditions. Branches separated by a blank line are aligned as independent groups."
},
"postgresQueryBuilder.format.alignSingleLineCase": {
"type": "boolean",
"default": false,
"description": "Align consecutive single-line CASE ... END expressions at their THEN, ELSE and END so the result, ELSE result and closing END line up. Expressions separated by a blank line are aligned as independent groups."
},
"postgresQueryBuilder.format.alignSingleLineIf": {
"type": "boolean",
"default": false,
"description": "Align consecutive single-line IF ... THEN ... END IF; statements at their THEN and END IF so the body and the closing END IF line up. Statements separated by a blank line are aligned as independent groups."
},
"postgresQueryBuilder.format.alignFunctionParameters": {
"type": "boolean",
"default": false,
"description": "Align the type column of a CREATE FUNCTION/PROCEDURE parameter list that is written one parameter per line, by padding the parameter names so every type starts in the same column."
},
"postgresQueryBuilder.format.alignNamedArguments": {
"type": "boolean",
"default": false,
"description": "Align the => of named call arguments written one per line, by padding the argument names so every => starts in the same column. Arguments at a different indent or separated by a blank line are aligned as independent groups."
},
"postgresQueryBuilder.format.spaceAroundJsonOperators": {
"type": "boolean",
"default": false,
"description": "Put a space on each side of the JSON/JSONB path operators ->, ->>, #> and #>> (e.g. 'rec.col ->> 'id'' instead of 'rec.col->>'id''). Off by default, which keeps the operators tight against their operands."
},
"postgresQueryBuilder.format.replaceDashesInBlockComments": {
"type": "boolean",
"default": false,
"description": "Replace every run of two or more dashes inside a /* ... */ block comment with the same number of equals signs, e.g. '/*--- Build report ----- */' becomes '/*=== Build report ===== */'. This includes block comments in function bodies and other dollar-quoted code the formatter reformats. Single dashes, -- line comments, string literals and dollar-quoted strings kept verbatim are never changed. Off by default."
},
"postgresQueryBuilder.format.requireSchemaQualifier": {
"type": "array",
"default": [],
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"function",
"procedure",
"table",
"view",
"materializedView",
"sequence",
"type",
"domain"
],
"enumDescriptions": [
"CREATE FUNCTION must name a schema (e.g. public.fn).",
"CREATE PROCEDURE must name a schema.",
"CREATE TABLE must name a schema.",
"CREATE VIEW must name a schema.",
"CREATE MATERIALIZED VIEW must name a schema.",
"CREATE SEQUENCE must name a schema.",
"CREATE TYPE must name a schema.",
"CREATE DOMAIN must name a schema."
]
},
"description": "Formatter checks: object kinds whose CREATE statement should name a schema (e.g. 'public.orders'). When a listed kind is created without a schema qualifier, the file is still formatted but a warning naming the statement and line is shown. Temporary objects are exempt. Empty by default (no checks)."
},
"postgresQueryBuilder.format.preserveSingleLineSpecialCases": {
"type": "boolean",
"default": true,
"description": "Deprecated umbrella switch for single-line special cases. Use preserveSingleLineRoutineHeaders and preserveSingleLineIfBlocks instead.",
"deprecationMessage": "Deprecated: use postgresQueryBuilder.format.preserveSingleLineRoutineHeaders and postgresQueryBuilder.format.preserveSingleLineIfBlocks."
},
"postgresQueryBuilder.format.normalizeDataTypes": {
"type": "boolean",
"default": true,
"description": "Replace verbose multi-word type names with their short form when formatting (e.g. 'character varying' -> 'varchar', 'timestamp without time zone' -> 'timestamp', 'timestamp with time zone' -> 'timestamptz')."
},
"postgresQueryBuilder.format.dataTypeAliases": {
"type": "object",
"default": {
"timestamp without time zone": "timestamp",
"timestamp with time zone": "timestamptz",
"time without time zone": "time",
"time with time zone": "timetz",
"int2": "smallint",
"int4": "integer",
"int8": "bigint",
"character varying": "varchar",
"bit varying": "varbit"
},
"additionalProperties": {
"type": "string"
},
"description": "Table of phrase replacements used when normalizeDataTypes is enabled: key = verbose type phrase, value = canonical replacement (e.g. 'character varying' -> 'varchar')."
},
"postgresQueryBuilder.format.argumentGroups": {
"type": "object",
"default": {
"json_build_object": "2",
"jsonb_build_object": "2",
"decode": "1+2"
},
"additionalProperties": {
"type": "string"
},
"description": "Functions whose arguments belong together in tuples: key = function name (optionally schema-qualified, e.g. 'oracle.decode'), value = '+'-separated group sizes whose last entry repeats. '2' puts key/value pairs on one line, '1+2' keeps the first argument alone and pairs the rest (DECODE), '1+1+2' gives the first two arguments a line each. A value of '0' switches a built-in entry off."
},
"postgresQueryBuilder.format.listThresholds": {
"type": "object",
"default": {
"createFunction": "0, 1",
"createProcedure": "0, 1",
"createType": "1, 2",
"createTable": "0, 1",
"returnsTable": "1, 4",
"functionCall": "1, 4",
"selectColumns": "1, 3",
"fromTables": "1, 4",
"groupByColumns": "1, 4",
"orderByColumns": "1, 4",
"insertColumns": "2, 10",
"valuesRows": "1, 10",
"arrayLiterals": "2, 10",
"inLists": "2, 10",
"booleanGroups": "1, 3",
"joinConditions": "1, 3",
"ifConditions": "1, 3",
"caseConditions": "1, 3",
"operatorChains": "1, 6",
"caseWhenThen": "0, 3",
"exceptionWhenThen": "0, 3",
"ifElse": "0, 3"
},
"properties": {
"createFunction": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "CREATE FUNCTION parameter list – \"inlineMax, multilineMin\": single line with at most inlineMax parameters, multi-line from multilineMin parameters on, in between as written in the source. With \"0, 1\" even a single parameter is wrapped. Default: 0, 1."
},
"createProcedure": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "CREATE PROCEDURE parameter list – \"inlineMax, multilineMin\": single line with at most inlineMax parameters, multi-line from multilineMin parameters on, in between as written in the source. With \"0, 1\" even a single parameter is wrapped. Default: 0, 1."
},
"createType": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "CREATE TYPE attribute list (composite types as well as ENUM/RANGE) – \"inlineMax, multilineMin\": single line with at most inlineMax attributes, multi-line from multilineMin attributes on, in between as written in the source. Default: 1, 4."
},
"createTable": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "CREATE TABLE column list – \"inlineMax, multilineMin\": single line with at most inlineMax columns, multi-line from multilineMin columns on, in between as written in the source. Default: 1, 4."
},
"returnsTable": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "RETURNS TABLE(...) column list of a CREATE FUNCTION – \"inlineMax, multilineMin\": single line with at most inlineMax columns, multi-line from multilineMin columns on, in between as written in the source. Default: 1, 4."
},
"functionCall": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "Function/procedure call argument list – \"inlineMax, multilineMin\": single line with at most inlineMax arguments, multi-line from multilineMin arguments on, in between as written in the source. Default: 1, 4."
},
"selectColumns": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "SELECT column list and INTO target list – \"inlineMax, multilineMin\": single line with at most inlineMax columns, multi-line from multilineMin columns on, in between as written in the source. Default: 1, 2."
},
"fromTables": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "FROM table list in comma style (FROM a, b, c) – \"inlineMax, multilineMin\": single line with at most inlineMax tables, multi-line from multilineMin tables on, in between as written in the source. Default: 1, 4."
},
"groupByColumns": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "GROUP BY column list – \"inlineMax, multilineMin\": single line with at most inlineMax columns, multi-line from multilineMin columns on, in between as written in the source. Default: 1, 4."
},
"orderByColumns": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "ORDER BY column list (incl. ASC/DESC/NULLS FIRST/LAST) – \"inlineMax, multilineMin\": single line with at most inlineMax columns, multi-line from multilineMin columns on, in between as written in the source. Default: 1, 4."
},
"insertColumns": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "INSERT column list and VALUES list – \"inlineMax, multilineMin\": single line with at most inlineMax columns, multi-line from multilineMin columns on, in between as written in the source. The column list and the VALUES list always use the same layout. Default: 2, 6."
},
"valuesRows": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "Row tuples of a multi-row VALUES list – \"inlineMax, multilineMin\": single line with at most inlineMax rows, one row per line from multilineMin rows on, in between as written in the source. What is inside one tuple is laid out by insertColumns. Default: 1, 10."
},
"arrayLiterals": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "ARRAY literals (ARRAY[...] incl. nested element arrays; index accesses arr[i] stay on one line) – \"inlineMax, multilineMin\": single line with at most inlineMax elements, multi-line from multilineMin elements on, in between as written in the source. Default: 4, 12."
},
"inLists": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "IN value lists (IN (...)) – \"inlineMax, multilineMin\": single line with at most inlineMax values, multi-line from multilineMin values on, in between as written in the source. Default: 4, 12."
},
"booleanGroups": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "Boolean groups in parentheses ((a AND b OR c)) – \"inlineMax, multilineMin\": single line with at most inlineMax operands, multi-line from multilineMin operands on, in between as written in the source. Default: 1, 2."
},
"joinConditions": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "JOIN ... ON ... AND ... conditions – \"inlineMax, multilineMin\": single line with at most inlineMax sub-conditions, multi-line from multilineMin sub-conditions on (every AND/OR on its own line), in between as written in the source. Default: 1, 2."
},
"ifConditions": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "IF/ELSIF conditions – \"inlineMax, multilineMin\": single line with at most inlineMax sub-conditions, multi-line from multilineMin sub-conditions on (every AND/OR on its own line), in between as written in the source. Default: 1, 2."
},
"caseConditions": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "CASE ... WHEN conditions (AND/OR inside a WHEN condition) – \"inlineMax, multilineMin\": single line with at most inlineMax sub-conditions, multi-line from multilineMin sub-conditions on, in between as written in the source. Default: 1, 2."
},
"operatorChains": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "Operator chains (+, -, *, /, ||) in an expression – \"inlineMax, multilineMin\": single line with at most inlineMax operands, multi-line from multilineMin operands on (every operator starts a line), in between as written in the source. Default: 1, 8."
},
"caseWhenThen": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "Collapsing a CASE ... WHEN ... THEN ... END CASE block – \"inlineMax, multilineMin\". Only inlineMax takes effect: the block is rendered on one line when its number of statements (;) is <= inlineMax and the body contains no comments or nested blocks. inlineMax 0 = never collapse."
},
"exceptionWhenThen": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "Collapsing an EXCEPTION WHEN ... THEN section – \"inlineMax, multilineMin\". Only inlineMax takes effect: the section is rendered on one line when its number of statements (;) is <= inlineMax and it contains no comments or nested blocks (the END of the BEGIN stays on its own line). inlineMax 0 = never collapse."
},
"ifElse": {
"type": "string",
"pattern": "^\\s*\\d+\\s*[,;: ]\\s*\\d+\\s*$",
"description": "Collapsing an IF ... [ELSE ...] END IF block – \"inlineMax, multilineMin\". Only inlineMax takes effect: the block is rendered on one line when its number of statements (;) is <= inlineMax and the body contains no comments or nested blocks. inlineMax 0 = never collapse."
}
},
"additionalProperties": false,
"markdownDescription": "Multi-line thresholds per construct, as a table. Each value is the pair `\"inlineMax, multilineMin\"`: a list with **at most** `inlineMax` elements always stays on one line, a list with **at least** `multilineMin` elements is always wrapped across lines, and in between the layout in the source decides (one line stays one line, multi-line stays multi-line). For the three structural blocks `caseWhenThen`, `exceptionWhenThen` and `ifElse` only `inlineMax` takes effect: a small block is collapsed onto one line when its number of statements (`;`) is `<= inlineMax` and the body contains no comments or nested blocks (`inlineMax = 0` = never collapse)."
}
}
}
]
},
"scripts": {
"vscode:prepublish": "npm run package",
"compile": "node esbuild.js",
"compile:test": "tsc -p ./",
"typecheck": "tsc -p ./ --noEmit",
"watch": "node esbuild.js --watch",
"esbuild": "node esbuild.js",
"esbuild:watch": "node esbuild.js --watch",
"package": "node esbuild.js --minify",
"start-server": "node dist/server.js",
"format-cli": "node dist/cli.js",
"lint": "eslint src server cli",
"test": "npm run compile:test && node --test out/src/test/**/*.test.js",
"bump:patch": "npm version patch --no-git-tag-version",
"bump:minor": "npm version minor --no-git-tag-version",
"bump:major": "npm version major --no-git-tag-version",
"patch": "npm run bump:patch",
"minor": "npm run bump:minor",
"major": "npm run bump:major",
"build-cli-exe": "node esbuild.js --minify --sea",
"build-cli-exe:all": "node esbuild.js --minify && pkg dist/cli.js --targets node18-win-x64,node18-linux-x64,node18-macos-x64 --out-path dist/binaries",
"deploy": "npx --yes @vscode/vsce package && npm run build-cli-exe",
"deploy:patch": "npm run patch && npm run deploy",
"deploy:minor": "npm run minor && npm run deploy",
"deploy:major": "npm run major && npm run deploy",
"d": "npm run deploy",
"d1": "npm run deploy:patch",
"d2": "npm run deploy:minor",
"d3": "npm run deploy:major"
},
"devDependencies": {
"@types/node": "^18.19.0",
"@types/pg": "^8.10.9",
"@types/vscode": "^1.85.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@yao-pkg/pkg": "^5.12.0",
"esbuild": "^0.28.1",
"eslint": "^9.0.0",
"monaco-editor": "^0.57.0",
"typescript": "^5.3.3",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-textdocument": "^1.0.12"
},
"dependencies": {
"exceljs": "^4.4.0",
"pg": "^8.11.3"
},
"overrides": {
"uuid": "^11.1.1"
}
}