neonctl 2.27.1 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +35 -3
  2. package/dist/analytics.js +52 -34
  3. package/dist/api.js +643 -13
  4. package/dist/auth.js +50 -44
  5. package/dist/cli.js +8 -1
  6. package/dist/commands/auth.js +64 -51
  7. package/dist/commands/bootstrap.js +115 -157
  8. package/dist/commands/branches.js +160 -150
  9. package/dist/commands/bucket.js +183 -146
  10. package/dist/commands/checkout.js +51 -51
  11. package/dist/commands/config.js +228 -82
  12. package/dist/commands/connection_string.js +62 -62
  13. package/dist/commands/data_api.js +100 -101
  14. package/dist/commands/databases.js +29 -26
  15. package/dist/commands/deploy.js +12 -12
  16. package/dist/commands/dev.js +114 -114
  17. package/dist/commands/env.js +43 -43
  18. package/dist/commands/functions.js +101 -104
  19. package/dist/commands/index.js +27 -25
  20. package/dist/commands/init.js +23 -22
  21. package/dist/commands/ip_allow.js +29 -29
  22. package/dist/commands/link.js +232 -182
  23. package/dist/commands/neon_auth.js +385 -370
  24. package/dist/commands/operations.js +11 -11
  25. package/dist/commands/orgs.js +8 -8
  26. package/dist/commands/projects.js +103 -101
  27. package/dist/commands/psql.js +31 -31
  28. package/dist/commands/roles.js +27 -24
  29. package/dist/commands/schema_diff.js +25 -26
  30. package/dist/commands/set_context.js +17 -17
  31. package/dist/commands/status.js +40 -0
  32. package/dist/commands/user.js +5 -5
  33. package/dist/commands/vpc_endpoints.js +50 -50
  34. package/dist/config.js +7 -7
  35. package/dist/config_format.js +5 -5
  36. package/dist/context.js +37 -14
  37. package/dist/current_branch_fast_path.js +55 -0
  38. package/dist/dev/env.js +33 -33
  39. package/dist/dev/functions.js +4 -4
  40. package/dist/dev/inputs.js +6 -6
  41. package/dist/dev/runtime.js +25 -25
  42. package/dist/env.js +14 -14
  43. package/dist/env_file.js +13 -13
  44. package/dist/errors.js +68 -5
  45. package/dist/functions_api.js +10 -10
  46. package/dist/help.js +15 -15
  47. package/dist/index.js +110 -107
  48. package/dist/log.js +2 -2
  49. package/dist/parameters.gen.js +14 -14
  50. package/dist/pkg.js +5 -5
  51. package/dist/psql/cli.js +4 -2
  52. package/dist/psql/command/cmd_cond.js +61 -61
  53. package/dist/psql/command/cmd_connect.js +159 -154
  54. package/dist/psql/command/cmd_copy.js +107 -97
  55. package/dist/psql/command/cmd_describe.js +368 -363
  56. package/dist/psql/command/cmd_format.js +276 -263
  57. package/dist/psql/command/cmd_io.js +269 -263
  58. package/dist/psql/command/cmd_lo.js +74 -66
  59. package/dist/psql/command/cmd_meta.js +148 -148
  60. package/dist/psql/command/cmd_misc.js +17 -17
  61. package/dist/psql/command/cmd_pipeline.js +142 -135
  62. package/dist/psql/command/cmd_restrict.js +25 -25
  63. package/dist/psql/command/cmd_show.js +183 -168
  64. package/dist/psql/command/dispatch.js +26 -26
  65. package/dist/psql/command/shared.js +14 -14
  66. package/dist/psql/complete/filenames.js +16 -16
  67. package/dist/psql/complete/index.js +4 -4
  68. package/dist/psql/complete/matcher.js +33 -32
  69. package/dist/psql/complete/psqlVars.js +173 -173
  70. package/dist/psql/complete/queries.js +5 -3
  71. package/dist/psql/complete/rules.js +900 -863
  72. package/dist/psql/core/common.js +136 -133
  73. package/dist/psql/core/help.js +343 -343
  74. package/dist/psql/core/mainloop.js +160 -153
  75. package/dist/psql/core/prompt.js +126 -123
  76. package/dist/psql/core/settings.js +111 -111
  77. package/dist/psql/core/sqlHelp.js +150 -150
  78. package/dist/psql/core/startup.js +211 -205
  79. package/dist/psql/core/syncVars.js +14 -14
  80. package/dist/psql/core/variables.js +24 -24
  81. package/dist/psql/describe/formatters.js +302 -289
  82. package/dist/psql/describe/processNamePattern.js +28 -28
  83. package/dist/psql/describe/queries.js +656 -651
  84. package/dist/psql/index.js +436 -411
  85. package/dist/psql/io/history.js +36 -36
  86. package/dist/psql/io/input.js +15 -15
  87. package/dist/psql/io/lineEditor/buffer.js +27 -25
  88. package/dist/psql/io/lineEditor/complete.js +15 -15
  89. package/dist/psql/io/lineEditor/filename.js +22 -22
  90. package/dist/psql/io/lineEditor/index.js +65 -62
  91. package/dist/psql/io/lineEditor/keymap.js +325 -318
  92. package/dist/psql/io/lineEditor/vt100.js +60 -60
  93. package/dist/psql/io/pgpass.js +18 -18
  94. package/dist/psql/io/pgservice.js +14 -14
  95. package/dist/psql/io/psqlrc.js +46 -46
  96. package/dist/psql/print/aligned.js +175 -166
  97. package/dist/psql/print/asciidoc.js +51 -51
  98. package/dist/psql/print/crosstab.js +34 -31
  99. package/dist/psql/print/csv.js +25 -22
  100. package/dist/psql/print/html.js +54 -54
  101. package/dist/psql/print/json.js +12 -12
  102. package/dist/psql/print/latex.js +118 -118
  103. package/dist/psql/print/pager.js +28 -26
  104. package/dist/psql/print/troff.js +48 -48
  105. package/dist/psql/print/unaligned.js +15 -14
  106. package/dist/psql/print/units.js +17 -17
  107. package/dist/psql/scanner/slash.js +48 -46
  108. package/dist/psql/scanner/sql.js +88 -84
  109. package/dist/psql/scanner/stringutils.js +21 -17
  110. package/dist/psql/types/index.js +7 -7
  111. package/dist/psql/types/scanner.js +8 -8
  112. package/dist/psql/wire/connection.js +341 -327
  113. package/dist/psql/wire/copy.js +7 -7
  114. package/dist/psql/wire/pipeline.js +26 -24
  115. package/dist/psql/wire/protocol.js +102 -102
  116. package/dist/psql/wire/sasl.js +62 -62
  117. package/dist/psql/wire/tls.js +79 -73
  118. package/dist/storage_api.js +22 -23
  119. package/dist/test_utils/fixtures.js +74 -41
  120. package/dist/test_utils/oauth_server.js +5 -5
  121. package/dist/utils/api_enums.js +33 -0
  122. package/dist/utils/branch_notice.js +5 -5
  123. package/dist/utils/branch_picker.js +26 -26
  124. package/dist/utils/compute_units.js +4 -4
  125. package/dist/utils/enrichers.js +28 -16
  126. package/dist/utils/esbuild.js +28 -28
  127. package/dist/utils/formats.js +1 -1
  128. package/dist/utils/middlewares.js +3 -3
  129. package/dist/utils/package_manager.js +68 -0
  130. package/dist/utils/point_in_time.js +12 -12
  131. package/dist/utils/psql.js +30 -30
  132. package/dist/utils/string.js +2 -2
  133. package/dist/utils/ui.js +9 -9
  134. package/dist/utils/zip.js +1 -1
  135. package/dist/writer.js +17 -17
  136. package/package.json +10 -12
@@ -13,8 +13,8 @@
13
13
  * {@link ./sqlHelp.ts} for the data and lookup logic. Rarer commands resolve
14
14
  * through the docs URL on each entry rather than being inlined here.
15
15
  */
16
- import { openPager } from '../print/pager.js';
17
- import { SQL_HELP, findMatches, formatEntry } from './sqlHelp.js';
16
+ import { openPager } from "../print/pager.js";
17
+ import { findMatches, formatEntry, SQL_HELP } from "./sqlHelp.js";
18
18
  let pagerOpener = openPager;
19
19
  /** Override the pager opener (tests only). Returns a restore function. */
20
20
  export const setHelpPagerOpener = (opener) => {
@@ -42,9 +42,9 @@ const emitHelp = (out, text, pager) => {
42
42
  return;
43
43
  }
44
44
  // Count lines so `openPager`'s auto-mode threshold reflects the real output.
45
- const lines = text.length === 0 ? 0 : text.split('\n').length;
45
+ const lines = text.length === 0 ? 0 : text.split("\n").length;
46
46
  const handle = pagerOpener({
47
- pager: 'on',
47
+ pager: "on",
48
48
  pagerMinLines: 0,
49
49
  lines,
50
50
  stdout: out,
@@ -56,13 +56,13 @@ const emitHelp = (out, text, pager) => {
56
56
  void handle.close();
57
57
  };
58
58
  const DEFAULTS = {
59
- progname: 'psql',
60
- defaultFieldSep: '|',
61
- defaultCsvFieldSep: ',',
62
- defaultWatchInterval: '2',
63
- packageBugReport: 'pgsql-bugs@lists.postgresql.org',
64
- packageName: 'PostgreSQL',
65
- packageUrl: 'https://www.postgresql.org/',
59
+ progname: "psql",
60
+ defaultFieldSep: "|",
61
+ defaultCsvFieldSep: ",",
62
+ defaultWatchInterval: "2",
63
+ packageBugReport: "pgsql-bugs@lists.postgresql.org",
64
+ packageName: "PostgreSQL",
65
+ packageUrl: "https://www.postgresql.org/",
66
66
  currentDb: null,
67
67
  htmlMode: false,
68
68
  tuplesOnly: false,
@@ -75,8 +75,8 @@ const resolve = (opts) => ({
75
75
  ...DEFAULTS,
76
76
  ...opts,
77
77
  });
78
- const on = (v) => (v ? 'on' : 'off');
79
- const expandedLabel = (v) => v === 'auto' ? 'auto' : on(v);
78
+ const on = (v) => (v ? "on" : "off");
79
+ const expandedLabel = (v) => v === "auto" ? "auto" : on(v);
80
80
  /**
81
81
  * `psql --help` text — top-level command-line options.
82
82
  *
@@ -91,62 +91,62 @@ export const usage = (out, opts) => {
91
91
  buf.push(s);
92
92
  };
93
93
  w(`${o.progname} is the PostgreSQL interactive terminal.\n\n`);
94
- w('Usage:\n');
94
+ w("Usage:\n");
95
95
  w(` ${o.progname} [OPTION]... [DBNAME [USERNAME]]\n\n`);
96
- w('General options:\n');
97
- w(' -c, --command=COMMAND run only single command (SQL or internal) and exit\n');
98
- w(' -d, --dbname=DBNAME database name to connect to\n');
99
- w(' -f, --file=FILENAME execute commands from file, then exit\n');
100
- w(' -l, --list list available databases, then exit\n');
101
- w(' -v, --set=, --variable=NAME=VALUE\n' +
102
- ' set psql variable NAME to VALUE\n' +
103
- ' (e.g., -v ON_ERROR_STOP=1)\n');
104
- w(' -V, --version output version information, then exit\n');
105
- w(' -X, --no-psqlrc do not read startup file (~/.psqlrc)\n');
96
+ w("General options:\n");
97
+ w(" -c, --command=COMMAND run only single command (SQL or internal) and exit\n");
98
+ w(" -d, --dbname=DBNAME database name to connect to\n");
99
+ w(" -f, --file=FILENAME execute commands from file, then exit\n");
100
+ w(" -l, --list list available databases, then exit\n");
101
+ w(" -v, --set=, --variable=NAME=VALUE\n" +
102
+ " set psql variable NAME to VALUE\n" +
103
+ " (e.g., -v ON_ERROR_STOP=1)\n");
104
+ w(" -V, --version output version information, then exit\n");
105
+ w(" -X, --no-psqlrc do not read startup file (~/.psqlrc)\n");
106
106
  w(' -1 ("one"), --single-transaction\n' +
107
- ' execute as a single transaction (if non-interactive)\n');
108
- w(' -?, --help[=options] show this help, then exit\n');
109
- w(' --help=commands list backslash commands, then exit\n');
110
- w(' --help=variables list special variables, then exit\n');
111
- w('\nInput and output options:\n');
112
- w(' -a, --echo-all echo all input from script\n');
113
- w(' -b, --echo-errors echo failed commands\n');
114
- w(' -e, --echo-queries echo commands sent to server\n');
115
- w(' -E, --echo-hidden display queries that internal commands generate\n');
116
- w(' -L, --log-file=FILENAME send session log to file\n');
117
- w(' -n, --no-readline disable enhanced command line editing (readline)\n');
118
- w(' -o, --output=FILENAME send query results to file (or |pipe)\n');
119
- w(' -q, --quiet run quietly (no messages, only query output)\n');
120
- w(' -s, --single-step single-step mode (confirm each query)\n');
121
- w(' -S, --single-line single-line mode (end of line terminates SQL command)\n');
122
- w('\nOutput format options:\n');
123
- w(' -A, --no-align unaligned table output mode\n');
124
- w(' --csv CSV (Comma-Separated Values) table output mode\n');
125
- w(' -F, --field-separator=STRING\n' +
107
+ " execute as a single transaction (if non-interactive)\n");
108
+ w(" -?, --help[=options] show this help, then exit\n");
109
+ w(" --help=commands list backslash commands, then exit\n");
110
+ w(" --help=variables list special variables, then exit\n");
111
+ w("\nInput and output options:\n");
112
+ w(" -a, --echo-all echo all input from script\n");
113
+ w(" -b, --echo-errors echo failed commands\n");
114
+ w(" -e, --echo-queries echo commands sent to server\n");
115
+ w(" -E, --echo-hidden display queries that internal commands generate\n");
116
+ w(" -L, --log-file=FILENAME send session log to file\n");
117
+ w(" -n, --no-readline disable enhanced command line editing (readline)\n");
118
+ w(" -o, --output=FILENAME send query results to file (or |pipe)\n");
119
+ w(" -q, --quiet run quietly (no messages, only query output)\n");
120
+ w(" -s, --single-step single-step mode (confirm each query)\n");
121
+ w(" -S, --single-line single-line mode (end of line terminates SQL command)\n");
122
+ w("\nOutput format options:\n");
123
+ w(" -A, --no-align unaligned table output mode\n");
124
+ w(" --csv CSV (Comma-Separated Values) table output mode\n");
125
+ w(" -F, --field-separator=STRING\n" +
126
126
  ` field separator for unaligned output (default: "${o.defaultFieldSep}")\n`);
127
- w(' -H, --html HTML table output mode\n');
128
- w(' -P, --pset=VAR[=ARG] set printing option VAR to ARG (see \\pset command)\n');
129
- w(' -R, --record-separator=STRING\n' +
130
- ' record separator for unaligned output (default: newline)\n');
131
- w(' -t, --tuples-only print rows only\n');
132
- w(' -T, --table-attr=TEXT set HTML table tag attributes (e.g., width, border)\n');
133
- w(' -x, --expanded turn on expanded table output\n');
134
- w(' -z, --field-separator-zero\n' +
135
- ' set field separator for unaligned output to zero byte\n');
136
- w(' -0, --record-separator-zero\n' +
137
- ' set record separator for unaligned output to zero byte\n');
138
- w('\nConnection options:\n');
139
- w(' -h, --host=HOSTNAME database server host or socket directory\n');
140
- w(' -p, --port=PORT database server port\n');
141
- w(' -U, --username=USERNAME database user name\n');
142
- w(' -w, --no-password never prompt for password\n');
143
- w(' -W, --password force password prompt (should happen automatically)\n');
127
+ w(" -H, --html HTML table output mode\n");
128
+ w(" -P, --pset=VAR[=ARG] set printing option VAR to ARG (see \\pset command)\n");
129
+ w(" -R, --record-separator=STRING\n" +
130
+ " record separator for unaligned output (default: newline)\n");
131
+ w(" -t, --tuples-only print rows only\n");
132
+ w(" -T, --table-attr=TEXT set HTML table tag attributes (e.g., width, border)\n");
133
+ w(" -x, --expanded turn on expanded table output\n");
134
+ w(" -z, --field-separator-zero\n" +
135
+ " set field separator for unaligned output to zero byte\n");
136
+ w(" -0, --record-separator-zero\n" +
137
+ " set record separator for unaligned output to zero byte\n");
138
+ w("\nConnection options:\n");
139
+ w(" -h, --host=HOSTNAME database server host or socket directory\n");
140
+ w(" -p, --port=PORT database server port\n");
141
+ w(" -U, --username=USERNAME database user name\n");
142
+ w(" -w, --no-password never prompt for password\n");
143
+ w(" -W, --password force password prompt (should happen automatically)\n");
144
144
  w('\nFor more information, type "\\?" (for internal commands) or "\\help" (for SQL\n' +
145
- 'commands) from within psql, or consult the psql section in the PostgreSQL\n' +
146
- 'documentation.\n\n');
145
+ "commands) from within psql, or consult the psql section in the PostgreSQL\n" +
146
+ "documentation.\n\n");
147
147
  w(`Report bugs to <${o.packageBugReport}>.\n`);
148
148
  w(`${o.packageName} home page: <${o.packageUrl}>\n`);
149
- out.write(buf.join(''));
149
+ out.write(buf.join(""));
150
150
  };
151
151
  /**
152
152
  * `\?` general output — help for the backslash commands.
@@ -161,173 +161,173 @@ export const slashUsage = (out, pager, opts) => {
161
161
  const w = (s) => {
162
162
  buf.push(s);
163
163
  };
164
- w('General\n');
165
- w(' \\copyright show PostgreSQL usage and distribution terms\n');
166
- w(' \\crosstabview [COLUMNS] execute query and display result in crosstab\n');
167
- w(' \\errverbose show most recent error message at maximum verbosity\n');
168
- w(' \\g [(OPTIONS)] [FILE] execute query (and send result to file or |pipe);\n' +
169
- ' \\g with no arguments is equivalent to a semicolon\n');
170
- w(' \\gdesc describe result of query, without executing it\n');
171
- w(' \\gexec execute query, then execute each value in its result\n');
172
- w(' \\gset [PREFIX] execute query and store result in psql variables\n');
173
- w(' \\gx [(OPTIONS)] [FILE] as \\g, but forces expanded output mode\n');
174
- w(' \\q quit psql\n');
175
- w(' \\restrict RESTRICT_KEY\n' +
176
- ' enter restricted mode with provided key\n');
177
- w(' \\unrestrict RESTRICT_KEY\n' +
178
- ' exit restricted mode if key matches\n');
179
- w(' \\watch [[i=]SEC] [c=N] [m=MIN]\n' +
180
- ' execute query every SEC seconds, up to N times,\n' +
181
- ' stop if less than MIN rows are returned\n');
182
- w('\n');
183
- w('Help\n');
184
- w(' \\? [commands] show help on backslash commands\n');
185
- w(' \\? options show help on psql command-line options\n');
186
- w(' \\? variables show help on special variables\n');
187
- w(' \\h [NAME] help on syntax of SQL commands, * for all commands\n');
188
- w('\n');
189
- w('Query Buffer\n');
190
- w(' \\e [FILE] [LINE] edit the query buffer (or file) with external editor\n');
191
- w(' \\ef [FUNCNAME [LINE]] edit function definition with external editor\n');
192
- w(' \\ev [VIEWNAME [LINE]] edit view definition with external editor\n');
193
- w(' \\p show the contents of the query buffer\n');
194
- w(' \\r reset (clear) the query buffer\n');
164
+ w("General\n");
165
+ w(" \\copyright show PostgreSQL usage and distribution terms\n");
166
+ w(" \\crosstabview [COLUMNS] execute query and display result in crosstab\n");
167
+ w(" \\errverbose show most recent error message at maximum verbosity\n");
168
+ w(" \\g [(OPTIONS)] [FILE] execute query (and send result to file or |pipe);\n" +
169
+ " \\g with no arguments is equivalent to a semicolon\n");
170
+ w(" \\gdesc describe result of query, without executing it\n");
171
+ w(" \\gexec execute query, then execute each value in its result\n");
172
+ w(" \\gset [PREFIX] execute query and store result in psql variables\n");
173
+ w(" \\gx [(OPTIONS)] [FILE] as \\g, but forces expanded output mode\n");
174
+ w(" \\q quit psql\n");
175
+ w(" \\restrict RESTRICT_KEY\n" +
176
+ " enter restricted mode with provided key\n");
177
+ w(" \\unrestrict RESTRICT_KEY\n" +
178
+ " exit restricted mode if key matches\n");
179
+ w(" \\watch [[i=]SEC] [c=N] [m=MIN]\n" +
180
+ " execute query every SEC seconds, up to N times,\n" +
181
+ " stop if less than MIN rows are returned\n");
182
+ w("\n");
183
+ w("Help\n");
184
+ w(" \\? [commands] show help on backslash commands\n");
185
+ w(" \\? options show help on psql command-line options\n");
186
+ w(" \\? variables show help on special variables\n");
187
+ w(" \\h [NAME] help on syntax of SQL commands, * for all commands\n");
188
+ w("\n");
189
+ w("Query Buffer\n");
190
+ w(" \\e [FILE] [LINE] edit the query buffer (or file) with external editor\n");
191
+ w(" \\ef [FUNCNAME [LINE]] edit function definition with external editor\n");
192
+ w(" \\ev [VIEWNAME [LINE]] edit view definition with external editor\n");
193
+ w(" \\p show the contents of the query buffer\n");
194
+ w(" \\r reset (clear) the query buffer\n");
195
195
  if (o.useReadline) {
196
- w(' \\s [FILE] display history or save it to file\n');
196
+ w(" \\s [FILE] display history or save it to file\n");
197
197
  }
198
- w(' \\w FILE write query buffer to file\n');
199
- w('\n');
200
- w('Input/Output\n');
201
- w(' \\copy ... perform SQL COPY with data stream to the client host\n');
202
- w(' \\echo [-n] [STRING] write string to standard output (-n for no newline)\n');
203
- w(' \\i FILE execute commands from file\n');
204
- w(' \\ir FILE as \\i, but relative to location of current script\n');
205
- w(' \\o [FILE] send all query results to file or |pipe\n');
206
- w(' \\qecho [-n] [STRING] write string to \\o output stream (-n for no newline)\n');
207
- w(' \\warn [-n] [STRING] write string to standard error (-n for no newline)\n');
208
- w('\n');
209
- w('Conditional\n');
210
- w(' \\if EXPR begin conditional block\n');
211
- w(' \\elif EXPR alternative within current conditional block\n');
212
- w(' \\else final alternative within current conditional block\n');
213
- w(' \\endif end conditional block\n');
214
- w('\n');
215
- w('Informational\n');
216
- w(' (options: S = show system objects, x = expanded mode, + = additional detail)\n');
217
- w(' \\d[Sx+] list tables, views, sequences, and property graphs\n');
218
- w(' \\d[S+] NAME describe table, view, sequence, index, or property graph\n');
219
- w(' \\da[Sx] [PATTERN] list aggregates\n');
220
- w(' \\dA[x+] [PATTERN] list access methods\n');
221
- w(' \\dAc[x+] [AMPTRN [TYPEPTRN]] list operator classes\n');
222
- w(' \\dAf[x+] [AMPTRN [TYPEPTRN]] list operator families\n');
223
- w(' \\dAo[x+] [AMPTRN [OPFPTRN]] list operators of operator families\n');
224
- w(' \\dAp[x+] [AMPTRN [OPFPTRN]] list support functions of operator families\n');
225
- w(' \\db[x+] [PATTERN] list tablespaces\n');
226
- w(' \\dc[Sx+] [PATTERN] list conversions\n');
227
- w(' \\dconfig[x+] [PATTERN] list configuration parameters\n');
228
- w(' \\dC[x+] [PATTERN] list casts\n');
229
- w(' \\dd[Sx] [PATTERN] show object descriptions not displayed elsewhere\n');
230
- w(' \\dD[Sx+] [PATTERN] list domains\n');
231
- w(' \\ddp[x] [PATTERN] list default privileges\n');
232
- w(' \\dE[Sx+] [PATTERN] list foreign tables\n');
233
- w(' \\des[x+] [PATTERN] list foreign servers\n');
234
- w(' \\det[x+] [PATTERN] list foreign tables\n');
235
- w(' \\deu[x+] [PATTERN] list user mappings\n');
236
- w(' \\dew[x+] [PATTERN] list foreign-data wrappers\n');
237
- w(' \\df[anptw][Sx+] [FUNCPTRN [TYPEPTRN ...]]\n' +
238
- ' list [only agg/normal/procedure/trigger/window] functions\n');
239
- w(' \\dF[x+] [PATTERN] list text search configurations\n');
240
- w(' \\dFd[x+] [PATTERN] list text search dictionaries\n');
241
- w(' \\dFp[x+] [PATTERN] list text search parsers\n');
242
- w(' \\dFt[x+] [PATTERN] list text search templates\n');
243
- w(' \\dg[Sx+] [PATTERN] list roles\n');
244
- w(' \\dG[Sx+] [PATTERN] list property graphs\n');
245
- w(' \\di[Sx+] [PATTERN] list indexes\n');
246
- w(' \\dl[x+] list large objects, same as \\lo_list\n');
247
- w(' \\dL[Sx+] [PATTERN] list procedural languages\n');
248
- w(' \\dm[Sx+] [PATTERN] list materialized views\n');
249
- w(' \\dn[Sx+] [PATTERN] list schemas\n');
250
- w(' \\do[Sx+] [OPPTRN [TYPEPTRN [TYPEPTRN]]]\n' +
251
- ' list operators\n');
252
- w(' \\dO[Sx+] [PATTERN] list collations\n');
253
- w(' \\dp[Sx] [PATTERN] list table, view, and sequence access privileges\n');
254
- w(' \\dP[itnx+] [PATTERN] list [only index/table] partitioned relations [n=nested]\n');
255
- w(' \\drds[x] [ROLEPTRN [DBPTRN]]\n' +
256
- ' list per-database role settings\n');
257
- w(' \\drg[Sx] [PATTERN] list role grants\n');
258
- w(' \\dRp[x+] [PATTERN] list replication publications\n');
259
- w(' \\dRs[x+] [PATTERN] list replication subscriptions\n');
260
- w(' \\ds[Sx+] [PATTERN] list sequences\n');
261
- w(' \\dt[Sx+] [PATTERN] list tables\n');
262
- w(' \\dT[Sx+] [PATTERN] list data types\n');
263
- w(' \\du[Sx+] [PATTERN] list roles\n');
264
- w(' \\dv[Sx+] [PATTERN] list views\n');
265
- w(' \\dx[x+] [PATTERN] list extensions\n');
266
- w(' \\dX[x+] [PATTERN] list extended statistics\n');
267
- w(' \\dy[x+] [PATTERN] list event triggers\n');
268
- w(' \\l[x+] [PATTERN] list databases\n');
198
+ w(" \\w FILE write query buffer to file\n");
199
+ w("\n");
200
+ w("Input/Output\n");
201
+ w(" \\copy ... perform SQL COPY with data stream to the client host\n");
202
+ w(" \\echo [-n] [STRING] write string to standard output (-n for no newline)\n");
203
+ w(" \\i FILE execute commands from file\n");
204
+ w(" \\ir FILE as \\i, but relative to location of current script\n");
205
+ w(" \\o [FILE] send all query results to file or |pipe\n");
206
+ w(" \\qecho [-n] [STRING] write string to \\o output stream (-n for no newline)\n");
207
+ w(" \\warn [-n] [STRING] write string to standard error (-n for no newline)\n");
208
+ w("\n");
209
+ w("Conditional\n");
210
+ w(" \\if EXPR begin conditional block\n");
211
+ w(" \\elif EXPR alternative within current conditional block\n");
212
+ w(" \\else final alternative within current conditional block\n");
213
+ w(" \\endif end conditional block\n");
214
+ w("\n");
215
+ w("Informational\n");
216
+ w(" (options: S = show system objects, x = expanded mode, + = additional detail)\n");
217
+ w(" \\d[Sx+] list tables, views, sequences, and property graphs\n");
218
+ w(" \\d[S+] NAME describe table, view, sequence, index, or property graph\n");
219
+ w(" \\da[Sx] [PATTERN] list aggregates\n");
220
+ w(" \\dA[x+] [PATTERN] list access methods\n");
221
+ w(" \\dAc[x+] [AMPTRN [TYPEPTRN]] list operator classes\n");
222
+ w(" \\dAf[x+] [AMPTRN [TYPEPTRN]] list operator families\n");
223
+ w(" \\dAo[x+] [AMPTRN [OPFPTRN]] list operators of operator families\n");
224
+ w(" \\dAp[x+] [AMPTRN [OPFPTRN]] list support functions of operator families\n");
225
+ w(" \\db[x+] [PATTERN] list tablespaces\n");
226
+ w(" \\dc[Sx+] [PATTERN] list conversions\n");
227
+ w(" \\dconfig[x+] [PATTERN] list configuration parameters\n");
228
+ w(" \\dC[x+] [PATTERN] list casts\n");
229
+ w(" \\dd[Sx] [PATTERN] show object descriptions not displayed elsewhere\n");
230
+ w(" \\dD[Sx+] [PATTERN] list domains\n");
231
+ w(" \\ddp[x] [PATTERN] list default privileges\n");
232
+ w(" \\dE[Sx+] [PATTERN] list foreign tables\n");
233
+ w(" \\des[x+] [PATTERN] list foreign servers\n");
234
+ w(" \\det[x+] [PATTERN] list foreign tables\n");
235
+ w(" \\deu[x+] [PATTERN] list user mappings\n");
236
+ w(" \\dew[x+] [PATTERN] list foreign-data wrappers\n");
237
+ w(" \\df[anptw][Sx+] [FUNCPTRN [TYPEPTRN ...]]\n" +
238
+ " list [only agg/normal/procedure/trigger/window] functions\n");
239
+ w(" \\dF[x+] [PATTERN] list text search configurations\n");
240
+ w(" \\dFd[x+] [PATTERN] list text search dictionaries\n");
241
+ w(" \\dFp[x+] [PATTERN] list text search parsers\n");
242
+ w(" \\dFt[x+] [PATTERN] list text search templates\n");
243
+ w(" \\dg[Sx+] [PATTERN] list roles\n");
244
+ w(" \\dG[Sx+] [PATTERN] list property graphs\n");
245
+ w(" \\di[Sx+] [PATTERN] list indexes\n");
246
+ w(" \\dl[x+] list large objects, same as \\lo_list\n");
247
+ w(" \\dL[Sx+] [PATTERN] list procedural languages\n");
248
+ w(" \\dm[Sx+] [PATTERN] list materialized views\n");
249
+ w(" \\dn[Sx+] [PATTERN] list schemas\n");
250
+ w(" \\do[Sx+] [OPPTRN [TYPEPTRN [TYPEPTRN]]]\n" +
251
+ " list operators\n");
252
+ w(" \\dO[Sx+] [PATTERN] list collations\n");
253
+ w(" \\dp[Sx] [PATTERN] list table, view, and sequence access privileges\n");
254
+ w(" \\dP[itnx+] [PATTERN] list [only index/table] partitioned relations [n=nested]\n");
255
+ w(" \\drds[x] [ROLEPTRN [DBPTRN]]\n" +
256
+ " list per-database role settings\n");
257
+ w(" \\drg[Sx] [PATTERN] list role grants\n");
258
+ w(" \\dRp[x+] [PATTERN] list replication publications\n");
259
+ w(" \\dRs[x+] [PATTERN] list replication subscriptions\n");
260
+ w(" \\ds[Sx+] [PATTERN] list sequences\n");
261
+ w(" \\dt[Sx+] [PATTERN] list tables\n");
262
+ w(" \\dT[Sx+] [PATTERN] list data types\n");
263
+ w(" \\du[Sx+] [PATTERN] list roles\n");
264
+ w(" \\dv[Sx+] [PATTERN] list views\n");
265
+ w(" \\dx[x+] [PATTERN] list extensions\n");
266
+ w(" \\dX[x+] [PATTERN] list extended statistics\n");
267
+ w(" \\dy[x+] [PATTERN] list event triggers\n");
268
+ w(" \\l[x+] [PATTERN] list databases\n");
269
269
  w(" \\sf[+] FUNCNAME show a function's definition\n");
270
270
  w(" \\sv[+] VIEWNAME show a view's definition\n");
271
- w(' \\z[Sx] [PATTERN] same as \\dp\n');
272
- w('\n');
273
- w('Large Objects\n');
274
- w(' \\lo_export LOBOID FILE write large object to file\n');
275
- w(' \\lo_import FILE [COMMENT]\n' +
276
- ' read large object from file\n');
277
- w(' \\lo_list[x+] list large objects\n');
278
- w(' \\lo_unlink LOBOID delete a large object\n');
279
- w('\n');
280
- w('Formatting\n');
281
- w(' \\a toggle between unaligned and aligned output mode\n');
282
- w(' \\C [STRING] set table title, or unset if none\n');
283
- w(' \\f [STRING] show or set field separator for unaligned query output\n');
271
+ w(" \\z[Sx] [PATTERN] same as \\dp\n");
272
+ w("\n");
273
+ w("Large Objects\n");
274
+ w(" \\lo_export LOBOID FILE write large object to file\n");
275
+ w(" \\lo_import FILE [COMMENT]\n" +
276
+ " read large object from file\n");
277
+ w(" \\lo_list[x+] list large objects\n");
278
+ w(" \\lo_unlink LOBOID delete a large object\n");
279
+ w("\n");
280
+ w("Formatting\n");
281
+ w(" \\a toggle between unaligned and aligned output mode\n");
282
+ w(" \\C [STRING] set table title, or unset if none\n");
283
+ w(" \\f [STRING] show or set field separator for unaligned query output\n");
284
284
  w(` \\H toggle HTML output mode (currently ${on(o.htmlMode)})\n`);
285
- w(' \\pset [NAME [VALUE]] set table output option\n' +
285
+ w(" \\pset [NAME [VALUE]] set table output option\n" +
286
286
  ' see "\\? variables" for valid options\n');
287
287
  w(` \\t [on|off] show only rows (currently ${on(o.tuplesOnly)})\n`);
288
- w(' \\T [STRING] set HTML <table> tag attributes, or unset if none\n');
288
+ w(" \\T [STRING] set HTML <table> tag attributes, or unset if none\n");
289
289
  w(` \\x [on|off|auto] toggle expanded output (currently ${expandedLabel(o.expanded)})\n`);
290
- w('\n');
291
- w('Connection\n');
290
+ w("\n");
291
+ w("Connection\n");
292
292
  if (o.currentDb) {
293
- w(' \\c[onnect] {[DBNAME|- USER|- HOST|- PORT|-] | conninfo}\n' +
293
+ w(" \\c[onnect] {[DBNAME|- USER|- HOST|- PORT|-] | conninfo}\n" +
294
294
  ` connect to new database (currently "${o.currentDb}")\n`);
295
295
  }
296
296
  else {
297
- w(' \\c[onnect] {[DBNAME|- USER|- HOST|- PORT|-] | conninfo}\n' +
298
- ' connect to new database (currently no connection)\n');
297
+ w(" \\c[onnect] {[DBNAME|- USER|- HOST|- PORT|-] | conninfo}\n" +
298
+ " connect to new database (currently no connection)\n");
299
299
  }
300
- w(' \\conninfo display information about current connection\n');
301
- w(' \\encoding [ENCODING] show or set client encoding\n');
302
- w(' \\password [USERNAME] securely change the password for a user\n');
303
- w('\n');
304
- w('Operating System\n');
305
- w(' \\cd [DIR] change the current working directory\n');
306
- w(' \\getenv PSQLVAR ENVVAR fetch environment variable\n');
307
- w(' \\setenv NAME [VALUE] set or unset environment variable\n');
300
+ w(" \\conninfo display information about current connection\n");
301
+ w(" \\encoding [ENCODING] show or set client encoding\n");
302
+ w(" \\password [USERNAME] securely change the password for a user\n");
303
+ w("\n");
304
+ w("Operating System\n");
305
+ w(" \\cd [DIR] change the current working directory\n");
306
+ w(" \\getenv PSQLVAR ENVVAR fetch environment variable\n");
307
+ w(" \\setenv NAME [VALUE] set or unset environment variable\n");
308
308
  w(` \\timing [on|off] toggle timing of commands (currently ${on(o.timing)})\n`);
309
- w(' \\! [COMMAND] execute command in shell or start interactive shell\n');
310
- w('\n');
311
- w('Variables\n');
312
- w(' \\prompt [TEXT] NAME prompt user to set internal variable\n');
313
- w(' \\set [NAME [VALUE]] set internal variable, or list all if no parameters\n');
314
- w(' \\unset NAME unset (delete) internal variable\n');
315
- w('\n');
316
- w('Extended Query Protocol\n');
317
- w(' \\bind [PARAM]... set query parameters\n');
318
- w(' \\bind_named STMT_NAME [PARAM]...\n' +
319
- ' set query parameters for an existing prepared statement\n');
320
- w(' \\close_prepared STMT_NAME\n' +
321
- ' close an existing prepared statement\n');
322
- w(' \\endpipeline exit pipeline mode\n');
323
- w(' \\flush flush output data to the server\n');
324
- w(' \\flushrequest send request to the server to flush its output buffer\n');
325
- w(' \\getresults [NUM_RES] read NUM_RES pending results, or all if no argument\n');
326
- w(' \\parse STMT_NAME create a prepared statement\n');
327
- w(' \\sendpipeline send an extended query to an ongoing pipeline\n');
328
- w(' \\startpipeline enter pipeline mode\n');
329
- w(' \\syncpipeline add a synchronisation point to an ongoing pipeline\n');
330
- emitHelp(out, buf.join(''), pager);
309
+ w(" \\! [COMMAND] execute command in shell or start interactive shell\n");
310
+ w("\n");
311
+ w("Variables\n");
312
+ w(" \\prompt [TEXT] NAME prompt user to set internal variable\n");
313
+ w(" \\set [NAME [VALUE]] set internal variable, or list all if no parameters\n");
314
+ w(" \\unset NAME unset (delete) internal variable\n");
315
+ w("\n");
316
+ w("Extended Query Protocol\n");
317
+ w(" \\bind [PARAM]... set query parameters\n");
318
+ w(" \\bind_named STMT_NAME [PARAM]...\n" +
319
+ " set query parameters for an existing prepared statement\n");
320
+ w(" \\close_prepared STMT_NAME\n" +
321
+ " close an existing prepared statement\n");
322
+ w(" \\endpipeline exit pipeline mode\n");
323
+ w(" \\flush flush output data to the server\n");
324
+ w(" \\flushrequest send request to the server to flush its output buffer\n");
325
+ w(" \\getresults [NUM_RES] read NUM_RES pending results, or all if no argument\n");
326
+ w(" \\parse STMT_NAME create a prepared statement\n");
327
+ w(" \\sendpipeline send an extended query to an ongoing pipeline\n");
328
+ w(" \\startpipeline enter pipeline mode\n");
329
+ w(" \\syncpipeline add a synchronisation point to an ongoing pipeline\n");
330
+ emitHelp(out, buf.join(""), pager);
331
331
  };
332
332
  /**
333
333
  * `\?` with a topic argument. Routes to the appropriate help renderer:
@@ -337,13 +337,13 @@ export const slashUsage = (out, pager, opts) => {
337
337
  */
338
338
  export const slashUsageHelp = (out, topic, opts) => {
339
339
  switch (topic) {
340
- case 'commands':
340
+ case "commands":
341
341
  slashUsage(out, false, opts);
342
342
  return;
343
- case 'options':
343
+ case "options":
344
344
  usage(out, opts);
345
345
  return;
346
- case 'variables':
346
+ case "variables":
347
347
  helpVariables(out, opts);
348
348
  return;
349
349
  }
@@ -358,148 +358,148 @@ export const helpVariables = (out, opts) => {
358
358
  const w = (s) => {
359
359
  buf.push(s);
360
360
  };
361
- w('List of specially treated variables\n\n');
362
- w('psql variables:\n');
363
- w('Usage:\n');
361
+ w("List of specially treated variables\n\n");
362
+ w("psql variables:\n");
363
+ w("Usage:\n");
364
364
  w(` ${o.progname} --set=NAME=VALUE\n or \\set NAME VALUE inside psql\n\n`);
365
- w(' AUTOCOMMIT\n' +
366
- ' if set, successful SQL commands are automatically committed\n');
367
- w(' COMP_KEYWORD_CASE\n' +
368
- ' determines the case used to complete SQL key words\n' +
369
- ' [lower, upper, preserve-lower, preserve-upper]\n');
370
- w(' DBNAME\n the currently connected database name\n');
371
- w(' ECHO\n' +
372
- ' controls what input is written to standard output\n' +
373
- ' [all, errors, none, queries]\n');
374
- w(' ECHO_HIDDEN\n' +
375
- ' if set, display internal queries executed by backslash commands;\n' +
365
+ w(" AUTOCOMMIT\n" +
366
+ " if set, successful SQL commands are automatically committed\n");
367
+ w(" COMP_KEYWORD_CASE\n" +
368
+ " determines the case used to complete SQL key words\n" +
369
+ " [lower, upper, preserve-lower, preserve-upper]\n");
370
+ w(" DBNAME\n the currently connected database name\n");
371
+ w(" ECHO\n" +
372
+ " controls what input is written to standard output\n" +
373
+ " [all, errors, none, queries]\n");
374
+ w(" ECHO_HIDDEN\n" +
375
+ " if set, display internal queries executed by backslash commands;\n" +
376
376
  ' if set to "noexec", just show them without execution\n');
377
- w(' ENCODING\n current client character set encoding\n');
377
+ w(" ENCODING\n current client character set encoding\n");
378
378
  w(' ERROR\n "true" if last query failed, else "false"\n');
379
- w(' FETCH_COUNT\n' +
380
- ' the number of result rows to fetch and display at a time (0 = unlimited)\n');
381
- w(' HIDE_TABLEAM\n if set, table access methods are not displayed\n');
382
- w(' HIDE_TOAST_COMPRESSION\n' +
383
- ' if set, compression methods are not displayed\n');
384
- w(' HISTCONTROL\n' +
385
- ' controls command history [ignorespace, ignoredups, ignoreboth]\n');
386
- w(' HISTFILE\n file name used to store the command history\n');
387
- w(' HISTSIZE\n' +
388
- ' maximum number of commands to store in the command history\n');
389
- w(' HOST\n the currently connected database server host\n');
390
- w(' IGNOREEOF\n' +
391
- ' number of EOFs needed to terminate an interactive session\n');
392
- w(' LASTOID\n value of the last affected OID\n');
393
- w(' LAST_ERROR_MESSAGE\n' +
394
- ' LAST_ERROR_SQLSTATE\n' +
379
+ w(" FETCH_COUNT\n" +
380
+ " the number of result rows to fetch and display at a time (0 = unlimited)\n");
381
+ w(" HIDE_TABLEAM\n if set, table access methods are not displayed\n");
382
+ w(" HIDE_TOAST_COMPRESSION\n" +
383
+ " if set, compression methods are not displayed\n");
384
+ w(" HISTCONTROL\n" +
385
+ " controls command history [ignorespace, ignoredups, ignoreboth]\n");
386
+ w(" HISTFILE\n file name used to store the command history\n");
387
+ w(" HISTSIZE\n" +
388
+ " maximum number of commands to store in the command history\n");
389
+ w(" HOST\n the currently connected database server host\n");
390
+ w(" IGNOREEOF\n" +
391
+ " number of EOFs needed to terminate an interactive session\n");
392
+ w(" LASTOID\n value of the last affected OID\n");
393
+ w(" LAST_ERROR_MESSAGE\n" +
394
+ " LAST_ERROR_SQLSTATE\n" +
395
395
  ' message and SQLSTATE of last error, or empty string and "00000" if none\n');
396
- w(' ON_ERROR_ROLLBACK\n' +
396
+ w(" ON_ERROR_ROLLBACK\n" +
397
397
  " if set, an error doesn't stop a transaction (uses implicit savepoints)\n");
398
- w(' ON_ERROR_STOP\n stop batch execution after error\n');
399
- w(' PORT\n server port of the current connection\n');
400
- w(' PROMPT1\n specifies the standard psql prompt\n');
401
- w(' PROMPT2\n' +
402
- ' specifies the prompt used when a statement continues from a previous line\n');
403
- w(' PROMPT3\n specifies the prompt used during COPY ... FROM STDIN\n');
404
- w(' QUIET\n run quietly (same as -q option)\n');
405
- w(' ROW_COUNT\n' +
406
- ' number of rows returned or affected by last query, or 0\n');
407
- w(' SERVER_VERSION_NAME\n' +
408
- ' SERVER_VERSION_NUM\n' +
398
+ w(" ON_ERROR_STOP\n stop batch execution after error\n");
399
+ w(" PORT\n server port of the current connection\n");
400
+ w(" PROMPT1\n specifies the standard psql prompt\n");
401
+ w(" PROMPT2\n" +
402
+ " specifies the prompt used when a statement continues from a previous line\n");
403
+ w(" PROMPT3\n specifies the prompt used during COPY ... FROM STDIN\n");
404
+ w(" QUIET\n run quietly (same as -q option)\n");
405
+ w(" ROW_COUNT\n" +
406
+ " number of rows returned or affected by last query, or 0\n");
407
+ w(" SERVER_VERSION_NAME\n" +
408
+ " SERVER_VERSION_NUM\n" +
409
409
  " server's version (in short string or numeric format)\n");
410
- w(' SHELL_ERROR\n' +
410
+ w(" SHELL_ERROR\n" +
411
411
  ' "true" if the last shell command failed, "false" if it succeeded\n');
412
- w(' SHELL_EXIT_CODE\n exit status of the last shell command\n');
413
- w(' SHOW_ALL_RESULTS\n' +
414
- ' show all results of a combined query (\\;) instead of only the last\n');
415
- w(' SHOW_CONTEXT\n' +
416
- ' controls display of message context fields [never, errors, always]\n');
417
- w(' SINGLELINE\n' +
418
- ' if set, end of line terminates SQL commands (same as -S option)\n');
419
- w(' SINGLESTEP\n single-step mode (same as -s option)\n');
412
+ w(" SHELL_EXIT_CODE\n exit status of the last shell command\n");
413
+ w(" SHOW_ALL_RESULTS\n" +
414
+ " show all results of a combined query (\\;) instead of only the last\n");
415
+ w(" SHOW_CONTEXT\n" +
416
+ " controls display of message context fields [never, errors, always]\n");
417
+ w(" SINGLELINE\n" +
418
+ " if set, end of line terminates SQL commands (same as -S option)\n");
419
+ w(" SINGLESTEP\n single-step mode (same as -s option)\n");
420
420
  w(' SQLSTATE\n SQLSTATE of last query, or "00000" if no error\n');
421
- w(' USER\n the currently connected database user\n');
422
- w(' VERBOSITY\n' +
423
- ' controls verbosity of error reports [default, verbose, terse, sqlstate]\n');
424
- w(' VERSION\n' +
425
- ' VERSION_NAME\n' +
426
- ' VERSION_NUM\n' +
421
+ w(" USER\n the currently connected database user\n");
422
+ w(" VERBOSITY\n" +
423
+ " controls verbosity of error reports [default, verbose, terse, sqlstate]\n");
424
+ w(" VERSION\n" +
425
+ " VERSION_NAME\n" +
426
+ " VERSION_NUM\n" +
427
427
  " psql's version (in verbose string, short string, or numeric format)\n");
428
- w(' WATCH_INTERVAL\n' +
428
+ w(" WATCH_INTERVAL\n" +
429
429
  ` number of seconds \\watch waits between executions (default ${o.defaultWatchInterval})\n`);
430
- w('\nDisplay settings:\n');
431
- w('Usage:\n');
430
+ w("\nDisplay settings:\n");
431
+ w("Usage:\n");
432
432
  w(` ${o.progname} --pset=NAME[=VALUE]\n or \\pset NAME [VALUE] inside psql\n\n`);
433
- w(' border\n border style (number)\n');
434
- w(' columns\n target width for the wrapped format\n');
435
- w(' csv_fieldsep\n' +
433
+ w(" border\n border style (number)\n");
434
+ w(" columns\n target width for the wrapped format\n");
435
+ w(" csv_fieldsep\n" +
436
436
  ` field separator for CSV output format (default "${o.defaultCsvFieldSep}")\n`);
437
- w(' display_false\n' +
437
+ w(" display_false\n" +
438
438
  " set the string to be printed in place of a boolean 'false'\n");
439
- w(' display_true\n' +
439
+ w(" display_true\n" +
440
440
  " set the string to be printed in place of a boolean 'true'\n");
441
- w(' expanded (or x)\n expanded output [on, off, auto]\n');
442
- w(' fieldsep\n' +
441
+ w(" expanded (or x)\n expanded output [on, off, auto]\n");
442
+ w(" fieldsep\n" +
443
443
  ` field separator for unaligned output (default "${o.defaultFieldSep}")\n`);
444
- w(' fieldsep_zero\n' +
445
- ' set field separator for unaligned output to a zero byte\n');
446
- w(' footer\n' +
447
- ' enable or disable display of the table footer [on, off]\n');
448
- w(' format\n' +
449
- ' set output format [unaligned, aligned, wrapped, html, asciidoc, ...]\n');
450
- w(' linestyle\n' +
451
- ' set the border line drawing style [ascii, old-ascii, unicode]\n');
452
- w(' null\n set the string to be printed in place of a null value\n');
453
- w(' numericlocale\n' +
454
- ' enable display of a locale-specific character to separate groups of digits\n');
455
- w(' pager\n' +
456
- ' control when an external pager is used [yes, no, always]\n');
457
- w(' recordsep\n record (line) separator for unaligned output\n');
458
- w(' recordsep_zero\n' +
459
- ' set record separator for unaligned output to a zero byte\n');
460
- w(' tableattr (or T)\n' +
461
- ' specify attributes for table tag in html format, or proportional\n' +
462
- ' column widths for left-aligned data types in latex-longtable format\n');
463
- w(' title\n set the table title for subsequently printed tables\n');
464
- w(' tuples_only\n if set, only actual table data is shown\n');
465
- w(' unicode_border_linestyle\n' +
466
- ' unicode_column_linestyle\n' +
467
- ' unicode_header_linestyle\n' +
468
- ' set the style of Unicode line drawing [single, double]\n');
469
- w(' xheader_width\n' +
470
- ' set the maximum width of the header for expanded output\n' +
471
- ' [full, column, page, integer value]\n');
472
- w('\nEnvironment variables:\n');
473
- w('Usage:\n');
444
+ w(" fieldsep_zero\n" +
445
+ " set field separator for unaligned output to a zero byte\n");
446
+ w(" footer\n" +
447
+ " enable or disable display of the table footer [on, off]\n");
448
+ w(" format\n" +
449
+ " set output format [unaligned, aligned, wrapped, html, asciidoc, ...]\n");
450
+ w(" linestyle\n" +
451
+ " set the border line drawing style [ascii, old-ascii, unicode]\n");
452
+ w(" null\n set the string to be printed in place of a null value\n");
453
+ w(" numericlocale\n" +
454
+ " enable display of a locale-specific character to separate groups of digits\n");
455
+ w(" pager\n" +
456
+ " control when an external pager is used [yes, no, always]\n");
457
+ w(" recordsep\n record (line) separator for unaligned output\n");
458
+ w(" recordsep_zero\n" +
459
+ " set record separator for unaligned output to a zero byte\n");
460
+ w(" tableattr (or T)\n" +
461
+ " specify attributes for table tag in html format, or proportional\n" +
462
+ " column widths for left-aligned data types in latex-longtable format\n");
463
+ w(" title\n set the table title for subsequently printed tables\n");
464
+ w(" tuples_only\n if set, only actual table data is shown\n");
465
+ w(" unicode_border_linestyle\n" +
466
+ " unicode_column_linestyle\n" +
467
+ " unicode_header_linestyle\n" +
468
+ " set the style of Unicode line drawing [single, double]\n");
469
+ w(" xheader_width\n" +
470
+ " set the maximum width of the header for expanded output\n" +
471
+ " [full, column, page, integer value]\n");
472
+ w("\nEnvironment variables:\n");
473
+ w("Usage:\n");
474
474
  if (!o.win32) {
475
475
  w(` NAME=VALUE [NAME=VALUE] ${o.progname} ...\n or \\setenv NAME [VALUE] inside psql\n\n`);
476
476
  }
477
477
  else {
478
478
  w(` set NAME=VALUE\n ${o.progname} ...\n or \\setenv NAME [VALUE] inside psql\n\n`);
479
479
  }
480
- w(' COLUMNS\n number of columns for wrapped format\n');
481
- w(' PGAPPNAME\n same as the application_name connection parameter\n');
482
- w(' PGDATABASE\n same as the dbname connection parameter\n');
483
- w(' PGHOST\n same as the host connection parameter\n');
484
- w(' PGPASSFILE\n password file name\n');
485
- w(' PGPASSWORD\n connection password (not recommended)\n');
486
- w(' PGPORT\n same as the port connection parameter\n');
487
- w(' PGUSER\n same as the user connection parameter\n');
488
- w(' PSQL_EDITOR, EDITOR, VISUAL\n' +
489
- ' editor used by the \\e, \\ef, and \\ev commands\n');
490
- w(' PSQL_EDITOR_LINENUMBER_ARG\n' +
491
- ' how to specify a line number when invoking the editor\n');
492
- w(' PSQL_HISTORY\n' +
493
- ' alternative location for the command history file\n');
494
- w(' PSQL_PAGER, PAGER\n name of external pager program\n');
480
+ w(" COLUMNS\n number of columns for wrapped format\n");
481
+ w(" PGAPPNAME\n same as the application_name connection parameter\n");
482
+ w(" PGDATABASE\n same as the dbname connection parameter\n");
483
+ w(" PGHOST\n same as the host connection parameter\n");
484
+ w(" PGPASSFILE\n password file name\n");
485
+ w(" PGPASSWORD\n connection password (not recommended)\n");
486
+ w(" PGPORT\n same as the port connection parameter\n");
487
+ w(" PGUSER\n same as the user connection parameter\n");
488
+ w(" PSQL_EDITOR, EDITOR, VISUAL\n" +
489
+ " editor used by the \\e, \\ef, and \\ev commands\n");
490
+ w(" PSQL_EDITOR_LINENUMBER_ARG\n" +
491
+ " how to specify a line number when invoking the editor\n");
492
+ w(" PSQL_HISTORY\n" +
493
+ " alternative location for the command history file\n");
494
+ w(" PSQL_PAGER, PAGER\n name of external pager program\n");
495
495
  if (!o.win32) {
496
- w(' PSQL_WATCH_PAGER\n' +
497
- ' name of external pager program used for \\watch\n');
496
+ w(" PSQL_WATCH_PAGER\n" +
497
+ " name of external pager program used for \\watch\n");
498
498
  }
499
499
  w(" PSQLRC\n alternative location for the user's .psqlrc file\n");
500
- w(' SHELL\n shell used by the \\! command\n');
501
- w(' TMPDIR\n directory for temporary files\n');
502
- out.write(buf.join(''));
500
+ w(" SHELL\n shell used by the \\! command\n");
501
+ w(" TMPDIR\n directory for temporary files\n");
502
+ out.write(buf.join(""));
503
503
  };
504
504
  /**
505
505
  * Render the "Available help:" overview — every command name in the table,
@@ -509,7 +509,7 @@ export const helpVariables = (out, opts) => {
509
509
  * tallest CREATE * entries line up cleanly.
510
510
  */
511
511
  const writeCommandList = (out, screenWidth) => {
512
- out.write('Available help:\n');
512
+ out.write("Available help:\n");
513
513
  const names = SQL_HELP.map((e) => e.cmd);
514
514
  const maxLen = names.reduce((m, n) => Math.max(m, n.length), 0);
515
515
  const colW = maxLen + 2;
@@ -518,7 +518,7 @@ const writeCommandList = (out, screenWidth) => {
518
518
  const cols = Math.max(1, Math.floor(usable / colW));
519
519
  const rows = Math.ceil(names.length / cols);
520
520
  for (let r = 0; r < rows; r++) {
521
- let line = ' ';
521
+ let line = " ";
522
522
  for (let c = 0; c < cols; c++) {
523
523
  const i = c * rows + r;
524
524
  if (i >= names.length)
@@ -526,9 +526,9 @@ const writeCommandList = (out, screenWidth) => {
526
526
  const name = names[i];
527
527
  // Last cell on the row: no trailing padding.
528
528
  const isLast = c === cols - 1 || (c + 1) * rows + r >= names.length;
529
- line += isLast ? name : name.padEnd(colW, ' ');
529
+ line += isLast ? name : name.padEnd(colW, " ");
530
530
  }
531
- out.write(line.replace(/\s+$/u, '') + '\n');
531
+ out.write(line.replace(/\s+$/u, "") + "\n");
532
532
  }
533
533
  };
534
534
  /** Render a single matched entry; pure formatter, exported for tests. */
@@ -561,7 +561,7 @@ export const helpSQL = (out, topic, screenWidth) => {
561
561
  const matches = findMatches(topic);
562
562
  if (matches.length === 0) {
563
563
  out.write(`No help available for "${topic}".\n` +
564
- 'Try \\h with no arguments to see available help.\n');
564
+ "Try \\h with no arguments to see available help.\n");
565
565
  return;
566
566
  }
567
567
  // psql has no "several matches" name listing — it prints the full help
@@ -570,7 +570,7 @@ export const helpSQL = (out, topic, screenWidth) => {
570
570
  // upstream's trailing newline after each entry's `URL:` line.
571
571
  matches.forEach((m, idx) => {
572
572
  if (idx > 0)
573
- out.write('\n');
573
+ out.write("\n");
574
574
  writeEntry(out, m);
575
575
  });
576
576
  };