neonctl 2.22.0 → 2.23.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.
- package/README.md +242 -16
- package/analytics.js +5 -2
- package/commands/branches.js +9 -1
- package/commands/checkout.js +249 -0
- package/commands/connection_string.js +15 -2
- package/commands/data_api.js +286 -0
- package/commands/functions.js +277 -0
- package/commands/index.js +12 -0
- package/commands/link.js +667 -0
- package/commands/neon_auth.js +1013 -0
- package/commands/projects.js +9 -1
- package/commands/psql.js +62 -0
- package/commands/set_context.js +7 -2
- package/context.js +86 -14
- package/functions_api.js +44 -0
- package/index.js +3 -0
- package/package.json +60 -51
- package/psql/cli.js +51 -0
- package/psql/command/cmd_cond.js +437 -0
- package/psql/command/cmd_connect.js +815 -0
- package/psql/command/cmd_copy.js +1025 -0
- package/psql/command/cmd_describe.js +1810 -0
- package/psql/command/cmd_format.js +909 -0
- package/psql/command/cmd_io.js +2187 -0
- package/psql/command/cmd_lo.js +385 -0
- package/psql/command/cmd_meta.js +970 -0
- package/psql/command/cmd_misc.js +187 -0
- package/psql/command/cmd_pipeline.js +1141 -0
- package/psql/command/cmd_restrict.js +171 -0
- package/psql/command/cmd_show.js +751 -0
- package/psql/command/dispatch.js +343 -0
- package/psql/command/inputQueue.js +42 -0
- package/psql/command/shared.js +71 -0
- package/psql/complete/filenames.js +139 -0
- package/psql/complete/index.js +104 -0
- package/psql/complete/matcher.js +314 -0
- package/psql/complete/psqlVars.js +247 -0
- package/psql/complete/queries.js +491 -0
- package/psql/complete/rules.js +2387 -0
- package/psql/core/common.js +1250 -0
- package/psql/core/help.js +576 -0
- package/psql/core/mainloop.js +1353 -0
- package/psql/core/prompt.js +437 -0
- package/psql/core/settings.js +684 -0
- package/psql/core/sqlHelp.js +1066 -0
- package/psql/core/startup.js +840 -0
- package/psql/core/syncVars.js +116 -0
- package/psql/core/variables.js +287 -0
- package/psql/describe/formatters.js +1277 -0
- package/psql/describe/processNamePattern.js +270 -0
- package/psql/describe/queries.js +2373 -0
- package/psql/describe/versionGate.js +43 -0
- package/psql/index.js +2005 -0
- package/psql/io/history.js +299 -0
- package/psql/io/input.js +120 -0
- package/psql/io/lineEditor/buffer.js +323 -0
- package/psql/io/lineEditor/complete.js +227 -0
- package/psql/io/lineEditor/filename.js +159 -0
- package/psql/io/lineEditor/index.js +891 -0
- package/psql/io/lineEditor/keymap.js +738 -0
- package/psql/io/lineEditor/vt100.js +363 -0
- package/psql/io/pgpass.js +202 -0
- package/psql/io/pgservice.js +194 -0
- package/psql/io/psqlrc.js +422 -0
- package/psql/print/aligned.js +1756 -0
- package/psql/print/asciidoc.js +248 -0
- package/psql/print/crosstab.js +460 -0
- package/psql/print/csv.js +92 -0
- package/psql/print/html.js +258 -0
- package/psql/print/json.js +96 -0
- package/psql/print/latex.js +396 -0
- package/psql/print/pager.js +265 -0
- package/psql/print/troff.js +258 -0
- package/psql/print/unaligned.js +118 -0
- package/psql/print/units.js +135 -0
- package/psql/scanner/slash.js +513 -0
- package/psql/scanner/sql.js +910 -0
- package/psql/scanner/stringutils.js +390 -0
- package/psql/types/backslash.js +1 -0
- package/psql/types/connection.js +1 -0
- package/psql/types/index.js +7 -0
- package/psql/types/printer.js +1 -0
- package/psql/types/repl.js +1 -0
- package/psql/types/scanner.js +24 -0
- package/psql/types/settings.js +1 -0
- package/psql/types/variables.js +1 -0
- package/psql/wire/connection.js +2844 -0
- package/psql/wire/copy.js +108 -0
- package/psql/wire/notify.js +59 -0
- package/psql/wire/pipeline.js +519 -0
- package/psql/wire/protocol.js +466 -0
- package/psql/wire/sasl.js +296 -0
- package/psql/wire/tls.js +596 -0
- package/test_utils/fixtures.js +1 -0
- package/utils/enrichers.js +18 -1
- package/utils/esbuild.js +147 -0
- package/utils/middlewares.js +1 -1
- package/utils/psql.js +107 -11
- package/utils/zip.js +4 -0
- package/writer.js +1 -1
- package/commands/auth.test.js +0 -211
- package/commands/branches.test.js +0 -460
- package/commands/connection_string.test.js +0 -196
- package/commands/databases.test.js +0 -39
- package/commands/help.test.js +0 -9
- package/commands/init.test.js +0 -56
- package/commands/ip_allow.test.js +0 -59
- package/commands/operations.test.js +0 -7
- package/commands/orgs.test.js +0 -7
- package/commands/projects.test.js +0 -144
- package/commands/roles.test.js +0 -37
- package/commands/set_context.test.js +0 -159
- package/commands/vpc_endpoints.test.js +0 -69
- package/env.test.js +0 -55
- package/utils/formats.test.js +0 -32
- package/writer.test.js +0 -104
package/writer.test.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { PassThrough } from 'node:stream';
|
|
2
|
-
import { describe, it, expect } from 'vitest';
|
|
3
|
-
import { writer } from './writer.js';
|
|
4
|
-
const getMockWritable = () => {
|
|
5
|
-
const chunks = [];
|
|
6
|
-
const stream = new PassThrough();
|
|
7
|
-
stream.on('data', (chunk) => {
|
|
8
|
-
chunks.push(chunk.toString());
|
|
9
|
-
});
|
|
10
|
-
return {
|
|
11
|
-
stream,
|
|
12
|
-
getData: () => {
|
|
13
|
-
return chunks.join('');
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
describe('writer', () => {
|
|
18
|
-
describe('outputs yaml', () => {
|
|
19
|
-
it('outputs single data', () => {
|
|
20
|
-
const { stream, getData } = getMockWritable();
|
|
21
|
-
const out = writer({ output: 'yaml', out: stream });
|
|
22
|
-
out.end({ foo: 'bar' }, { fields: ['foo'] });
|
|
23
|
-
expect(getData()).toMatchSnapshot();
|
|
24
|
-
});
|
|
25
|
-
it('outputs single data with title', () => {
|
|
26
|
-
const { stream, getData } = getMockWritable();
|
|
27
|
-
const out = writer({ output: 'yaml', out: stream });
|
|
28
|
-
out.end({ foo: 'bar' }, { fields: ['foo'], title: 'baz' });
|
|
29
|
-
expect(getData()).toMatchSnapshot();
|
|
30
|
-
});
|
|
31
|
-
it('outputs multiple data', () => {
|
|
32
|
-
const { stream, getData } = getMockWritable();
|
|
33
|
-
const out = writer({ output: 'yaml', out: stream });
|
|
34
|
-
out
|
|
35
|
-
.write({ foo: 'bar' }, { fields: ['foo'], title: 'T1' })
|
|
36
|
-
.write({ baz: 'xyz' }, { fields: ['baz'], title: 'T2' })
|
|
37
|
-
.end();
|
|
38
|
-
expect(getData()).toMatchSnapshot();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
describe('outputs json', () => {
|
|
42
|
-
it('outputs single data', () => {
|
|
43
|
-
const { stream, getData } = getMockWritable();
|
|
44
|
-
const out = writer({ output: 'json', out: stream });
|
|
45
|
-
out.end({ foo: 'bar' }, { fields: ['foo'] });
|
|
46
|
-
expect(getData()).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
it('outputs single data with title', () => {
|
|
49
|
-
const { stream, getData } = getMockWritable();
|
|
50
|
-
const out = writer({ output: 'json', out: stream });
|
|
51
|
-
out.end({ foo: 'bar' }, { fields: ['foo'], title: 'baz' });
|
|
52
|
-
expect(getData()).toMatchSnapshot();
|
|
53
|
-
});
|
|
54
|
-
it('outputs multiple data', () => {
|
|
55
|
-
const { stream, getData } = getMockWritable();
|
|
56
|
-
const out = writer({ output: 'json', out: stream });
|
|
57
|
-
out
|
|
58
|
-
.write({ foo: 'bar' }, { fields: ['foo'], title: 'T1' })
|
|
59
|
-
.write({ baz: 'xyz' }, { fields: ['baz'], title: 'T2' })
|
|
60
|
-
.end();
|
|
61
|
-
expect(getData()).toMatchSnapshot();
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
describe('outputs table', () => {
|
|
65
|
-
it('outputs single data', () => {
|
|
66
|
-
const { stream, getData } = getMockWritable();
|
|
67
|
-
const out = writer({ output: 'table', out: stream });
|
|
68
|
-
out.end({ foo: 'bar', extra: 'extra' }, { fields: ['foo'] });
|
|
69
|
-
expect(getData()).toMatchSnapshot();
|
|
70
|
-
});
|
|
71
|
-
it('outputs single data with title', () => {
|
|
72
|
-
const { stream, getData } = getMockWritable();
|
|
73
|
-
const out = writer({ output: 'table', out: stream });
|
|
74
|
-
out.end({ foo: 'bar', extra: 'extra' }, { fields: ['foo'], title: 'baz' });
|
|
75
|
-
expect(getData()).toMatchSnapshot();
|
|
76
|
-
});
|
|
77
|
-
it('outputs multiple data', () => {
|
|
78
|
-
const { stream, getData } = getMockWritable();
|
|
79
|
-
const out = writer({ output: 'table', out: stream });
|
|
80
|
-
out
|
|
81
|
-
.write({ foo: 'bar', extra: 'extra' }, { fields: ['foo'], title: 'T1' })
|
|
82
|
-
.write({ baz: 'xyz', extra: 'extra' }, { fields: ['baz'], title: 'T2' })
|
|
83
|
-
.end();
|
|
84
|
-
expect(getData()).toMatchSnapshot();
|
|
85
|
-
});
|
|
86
|
-
it('outputs table with custom renderer', () => {
|
|
87
|
-
const { stream, getData } = getMockWritable();
|
|
88
|
-
const out = writer({
|
|
89
|
-
output: 'table',
|
|
90
|
-
out: stream,
|
|
91
|
-
});
|
|
92
|
-
out
|
|
93
|
-
.write({ foo: 'bar' }, {
|
|
94
|
-
fields: ['foo'],
|
|
95
|
-
title: 'T1',
|
|
96
|
-
renderColumns: {
|
|
97
|
-
foo: ({ foo }) => `Here is: ${foo}`,
|
|
98
|
-
},
|
|
99
|
-
})
|
|
100
|
-
.end();
|
|
101
|
-
expect(getData()).toMatchSnapshot();
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|