@pgsql/cli 1.30.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 (50) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/LICENSE +21 -0
  3. package/README.md +268 -0
  4. package/dist/LICENSE +21 -0
  5. package/dist/README.md +268 -0
  6. package/dist/commands/deparse.d.ts +1 -0
  7. package/dist/commands/deparse.js +66 -0
  8. package/dist/commands/parse.d.ts +1 -0
  9. package/dist/commands/parse.js +60 -0
  10. package/dist/commands/proto-fetch/cli.d.ts +14 -0
  11. package/dist/commands/proto-fetch/cli.js +41 -0
  12. package/dist/commands/proto-fetch/helpers.d.ts +3 -0
  13. package/dist/commands/proto-fetch/helpers.js +73 -0
  14. package/dist/commands/proto-fetch.d.ts +1 -0
  15. package/dist/commands/proto-fetch.js +42 -0
  16. package/dist/commands/proto-gen.d.ts +1 -0
  17. package/dist/commands/proto-gen.js +59 -0
  18. package/dist/commands/runtime-schema.d.ts +1 -0
  19. package/dist/commands/runtime-schema.js +70 -0
  20. package/dist/esm/commands/deparse.js +60 -0
  21. package/dist/esm/commands/parse.js +54 -0
  22. package/dist/esm/commands/proto-fetch/cli.js +37 -0
  23. package/dist/esm/commands/proto-fetch/helpers.js +64 -0
  24. package/dist/esm/commands/proto-fetch.js +36 -0
  25. package/dist/esm/commands/proto-gen.js +53 -0
  26. package/dist/esm/commands/runtime-schema.js +64 -0
  27. package/dist/esm/index.js +56 -0
  28. package/dist/esm/package.js +26 -0
  29. package/dist/esm/utils/help.js +190 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.js +61 -0
  32. package/dist/package.d.ts +1 -0
  33. package/dist/package.js +29 -0
  34. package/dist/package.json +60 -0
  35. package/dist/utils/help.d.ts +2 -0
  36. package/dist/utils/help.js +197 -0
  37. package/jest.config.js +18 -0
  38. package/package.json +60 -0
  39. package/src/commands/deparse.ts +60 -0
  40. package/src/commands/parse.ts +60 -0
  41. package/src/commands/proto-fetch/cli.ts +52 -0
  42. package/src/commands/proto-fetch/helpers.ts +72 -0
  43. package/src/commands/proto-fetch.ts +42 -0
  44. package/src/commands/proto-gen.ts +49 -0
  45. package/src/commands/runtime-schema.ts +74 -0
  46. package/src/index.ts +69 -0
  47. package/src/package.ts +33 -0
  48. package/src/utils/help.ts +198 -0
  49. package/tsconfig.esm.json +9 -0
  50. package/tsconfig.json +9 -0
@@ -0,0 +1,36 @@
1
+ import chalk from 'chalk';
2
+ import { showHelp } from '../utils/help';
3
+ import { downloadProtoFile, generateProtoJS, replaceTextInProtoJS } from './proto-fetch/helpers';
4
+ export async function protoFetchCommand(argv) {
5
+ if (argv.help) {
6
+ showHelp('proto-fetch');
7
+ process.exit(0);
8
+ }
9
+ const url = argv.url;
10
+ const inFile = argv.inFile;
11
+ const outFile = argv.outFile;
12
+ const replacePkg = argv['replace-pkg'] || 'protobufjs/minimal';
13
+ const withPkg = argv['with-pkg'] || '@launchql/protobufjs/minimal';
14
+ if (!inFile || !outFile) {
15
+ console.error(chalk.red('Error: --inFile and --outFile are required'));
16
+ showHelp('proto-fetch');
17
+ process.exit(1);
18
+ }
19
+ try {
20
+ if (url) {
21
+ console.log(chalk.blue(`Downloading proto file from ${url}...`));
22
+ await downloadProtoFile(url, inFile);
23
+ console.log(chalk.green(`✓ Proto file saved to ${inFile}`));
24
+ }
25
+ console.log(chalk.blue('Generating JavaScript from proto file...'));
26
+ await generateProtoJS(inFile, outFile);
27
+ console.log(chalk.blue(`Replacing package references...`));
28
+ await replaceTextInProtoJS(outFile, replacePkg, withPkg);
29
+ console.log(chalk.green(`✓ All operations completed successfully`));
30
+ console.log(chalk.green(`✓ Generated file: ${outFile}`));
31
+ }
32
+ catch (error) {
33
+ console.error(chalk.red('Proto fetch error:'), error.message || error);
34
+ process.exit(1);
35
+ }
36
+ }
@@ -0,0 +1,53 @@
1
+ import { PgProtoParser, getOptionsWithDefaults } from 'pg-proto-parser';
2
+ import o from 'nested-obj';
3
+ import chalk from 'chalk';
4
+ import { showHelp } from '../utils/help';
5
+ export async function protoGenCommand(argv) {
6
+ if (argv.help) {
7
+ showHelp('proto-gen');
8
+ process.exit(0);
9
+ }
10
+ if (!argv.inFile || !argv.outDir) {
11
+ console.error(chalk.red('Error: --inFile and --outDir are required'));
12
+ showHelp('proto-gen');
13
+ process.exit(1);
14
+ }
15
+ try {
16
+ const options = getOptionsWithDefaults({
17
+ outDir: argv.outDir
18
+ });
19
+ // Set options based on flags
20
+ if (argv.enums)
21
+ o.set(options, 'enums.enabled', true);
22
+ if (argv['enums-json'])
23
+ o.set(options, 'enums.json.enabled', true);
24
+ if (argv.types)
25
+ o.set(options, 'types.enabled', true);
26
+ if (argv.utils)
27
+ o.set(options, 'utils.enums.enabled', true);
28
+ if (argv['ast-helpers'])
29
+ o.set(options, 'utils.astHelpers.enabled', true);
30
+ if (argv['wrapped-helpers'])
31
+ o.set(options, 'utils.wrappedAstHelpers.enabled', true);
32
+ if (argv.optional)
33
+ o.set(options, 'types.optionalFields', true);
34
+ if (argv['keep-case'])
35
+ o.set(options, 'parser.keepCase', true);
36
+ if (argv['remove-undefined'])
37
+ o.set(options, 'enums.removeUndefinedAt0', true);
38
+ // Additional options that might be useful
39
+ if (argv['type-union'])
40
+ o.set(options, 'enums.enumsAsTypeUnion', true);
41
+ if (argv.header)
42
+ o.set(options, 'includeHeader', true);
43
+ console.log(chalk.blue('Parsing protobuf file...'));
44
+ const parser = new PgProtoParser(argv.inFile, options);
45
+ console.log(chalk.blue('Generating TypeScript files...'));
46
+ await parser.write();
47
+ console.log(chalk.green(`✓ Files generated in ${argv.outDir}`));
48
+ }
49
+ catch (error) {
50
+ console.error(chalk.red('Proto generation error:'), error.message || error);
51
+ process.exit(1);
52
+ }
53
+ }
@@ -0,0 +1,64 @@
1
+ import { PgProtoParser, getOptionsWithDefaults } from 'pg-proto-parser';
2
+ import { writeFileSync } from 'fs';
3
+ import { join } from 'path';
4
+ import chalk from 'chalk';
5
+ import { showHelp } from '../utils/help';
6
+ export async function runtimeSchemaCommand(argv) {
7
+ if (argv.help) {
8
+ showHelp('runtime-schema');
9
+ process.exit(0);
10
+ }
11
+ if (!argv.inFile || !argv.outDir) {
12
+ console.error(chalk.red('Error: --inFile and --outDir are required'));
13
+ showHelp('runtime-schema');
14
+ process.exit(1);
15
+ }
16
+ const format = argv.format || 'json';
17
+ const filename = argv.filename || 'runtime-schema';
18
+ try {
19
+ console.log(chalk.blue('Parsing protobuf file...'));
20
+ const options = getOptionsWithDefaults({
21
+ outDir: argv.outDir
22
+ });
23
+ const parser = new PgProtoParser(argv.inFile, options);
24
+ // Generate runtime schema
25
+ console.log(chalk.blue(`Generating runtime schema in ${format} format...`));
26
+ console.log(chalk.yellow('Warning: Runtime schema generation is not yet fully implemented'));
27
+ // Generate placeholder schema based on format
28
+ let content;
29
+ let fileExt;
30
+ if (format === 'typescript') {
31
+ // Generate TypeScript runtime schema placeholder
32
+ content = `// Runtime schema for PostgreSQL AST nodes
33
+ // Generated from: ${argv.inFile}
34
+
35
+ export interface RuntimeSchema {
36
+ // TODO: Implement runtime schema generation
37
+ nodes: Record<string, any>;
38
+ }
39
+
40
+ export const runtimeSchema: RuntimeSchema = {
41
+ nodes: {}
42
+ };
43
+ `;
44
+ fileExt = '.ts';
45
+ }
46
+ else {
47
+ // Generate JSON runtime schema placeholder
48
+ content = JSON.stringify({
49
+ generated: new Date().toISOString(),
50
+ source: argv.inFile,
51
+ nodes: {}
52
+ }, null, 2);
53
+ fileExt = '.json';
54
+ }
55
+ // Write file
56
+ const outputPath = join(argv.outDir, `${filename}${fileExt}`);
57
+ writeFileSync(outputPath, content);
58
+ console.log(chalk.green(`✓ Runtime schema generated: ${outputPath}`));
59
+ }
60
+ catch (error) {
61
+ console.error(chalk.red('Runtime schema error:'), error.message || error);
62
+ process.exit(1);
63
+ }
64
+ }
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env node
2
+ import minimist from 'minimist';
3
+ import chalk from 'chalk';
4
+ import { parseCommand } from './commands/parse';
5
+ import { deparseCommand } from './commands/deparse';
6
+ import { protoGenCommand } from './commands/proto-gen';
7
+ import { protoFetchCommand } from './commands/proto-fetch';
8
+ import { runtimeSchemaCommand } from './commands/runtime-schema';
9
+ import { showHelp, showVersion } from './utils/help';
10
+ const argv = minimist(process.argv.slice(2), {
11
+ alias: {
12
+ h: 'help',
13
+ v: 'version',
14
+ o: 'output',
15
+ f: 'format'
16
+ }
17
+ });
18
+ const command = argv._[0];
19
+ async function main() {
20
+ try {
21
+ if (argv.version) {
22
+ showVersion();
23
+ process.exit(0);
24
+ }
25
+ if (!command || argv.help) {
26
+ showHelp(command);
27
+ process.exit(0);
28
+ }
29
+ switch (command) {
30
+ case 'parse':
31
+ await parseCommand(argv);
32
+ break;
33
+ case 'deparse':
34
+ await deparseCommand(argv);
35
+ break;
36
+ case 'proto-gen':
37
+ await protoGenCommand(argv);
38
+ break;
39
+ case 'proto-fetch':
40
+ await protoFetchCommand(argv);
41
+ break;
42
+ case 'runtime-schema':
43
+ await runtimeSchemaCommand(argv);
44
+ break;
45
+ default:
46
+ console.error(chalk.red(`Unknown command: ${command}`));
47
+ showHelp();
48
+ process.exit(1);
49
+ }
50
+ }
51
+ catch (error) {
52
+ console.error(chalk.red('Error:'), error.message || error);
53
+ process.exit(1);
54
+ }
55
+ }
56
+ main();
@@ -0,0 +1,26 @@
1
+ import { existsSync, readFileSync } from "fs";
2
+ import { dirname, join } from "path";
3
+ // need to search due to the dist/ folder and src/, etc.
4
+ function findPackageJson(currentDir) {
5
+ const filePath = join(currentDir, 'package.json');
6
+ // Check if package.json exists in the current directory
7
+ if (existsSync(filePath)) {
8
+ return filePath;
9
+ }
10
+ // Get the parent directory
11
+ const parentDir = dirname(currentDir);
12
+ // If reached the root directory, package.json is not found
13
+ if (parentDir === currentDir) {
14
+ throw new Error('package.json not found in any parent directory');
15
+ }
16
+ // Recursively look in the parent directory
17
+ return findPackageJson(parentDir);
18
+ }
19
+ export function readAndParsePackageJson() {
20
+ // Start searching from the current directory
21
+ const pkgPath = findPackageJson(__dirname);
22
+ // Read and parse the package.json
23
+ const str = readFileSync(pkgPath, 'utf8');
24
+ const pkg = JSON.parse(str);
25
+ return pkg;
26
+ }
@@ -0,0 +1,190 @@
1
+ import chalk from 'chalk';
2
+ import { readFileSync } from 'fs';
3
+ import { join } from 'path';
4
+ export function showVersion() {
5
+ // Try to find package.json in various locations
6
+ const possiblePaths = [
7
+ join(process.cwd(), 'package.json'),
8
+ join(process.argv[1], '../../package.json'),
9
+ join(process.argv[1], '../../../package.json')
10
+ ];
11
+ for (const path of possiblePaths) {
12
+ try {
13
+ const packageJson = JSON.parse(readFileSync(path, 'utf-8'));
14
+ if (packageJson.name === '@pgsql/cli') {
15
+ console.log(packageJson.version);
16
+ return;
17
+ }
18
+ }
19
+ catch {
20
+ // Continue to next path
21
+ }
22
+ }
23
+ // Fallback: just show the version we know
24
+ console.log('1.29.2');
25
+ }
26
+ export function showHelp(command) {
27
+ if (command) {
28
+ switch (command) {
29
+ case 'parse':
30
+ showParseHelp();
31
+ break;
32
+ case 'deparse':
33
+ showDeparseHelp();
34
+ break;
35
+ case 'proto-gen':
36
+ showProtoGenHelp();
37
+ break;
38
+ case 'proto-fetch':
39
+ showProtoFetchHelp();
40
+ break;
41
+ case 'runtime-schema':
42
+ showRuntimeSchemaHelp();
43
+ break;
44
+ default:
45
+ showGeneralHelp();
46
+ }
47
+ }
48
+ else {
49
+ showGeneralHelp();
50
+ }
51
+ }
52
+ function showGeneralHelp() {
53
+ console.log(`
54
+ ${chalk.bold('pgsql')} - Unified CLI for PostgreSQL AST operations
55
+
56
+ ${chalk.yellow('Usage:')}
57
+ pgsql <command> [options]
58
+
59
+ ${chalk.yellow('Commands:')}
60
+ ${chalk.green('parse')} Parse SQL to AST
61
+ ${chalk.green('deparse')} Convert AST to SQL
62
+ ${chalk.green('proto-gen')} Generate TypeScript from protobuf
63
+ ${chalk.green('proto-fetch')} Download and process proto files
64
+ ${chalk.green('runtime-schema')} Generate runtime schema for AST nodes
65
+
66
+ ${chalk.yellow('Global Options:')}
67
+ -h, --help Show help
68
+ -v, --version Show version
69
+
70
+ ${chalk.yellow('Examples:')}
71
+ pgsql parse query.sql
72
+ pgsql deparse ast.json
73
+ pgsql proto-gen --inFile pg_query.proto --outDir out
74
+ pgsql proto-fetch --url https://example.com/pg_query.proto --inFile pg_query.proto
75
+
76
+ Run 'pgsql <command> --help' for detailed help on a specific command.
77
+ `);
78
+ }
79
+ function showParseHelp() {
80
+ console.log(`
81
+ ${chalk.bold('pgsql parse')} - Parse SQL to AST
82
+
83
+ ${chalk.yellow('Usage:')}
84
+ pgsql parse <sqlfile> [options]
85
+
86
+ ${chalk.yellow('Options:')}
87
+ -o, --output <file> Output to file instead of stdout
88
+ -f, --format <format> Output format: json, pretty (default: pretty)
89
+ --clean Clean the AST tree (remove location info)
90
+ -h, --help Show help
91
+
92
+ ${chalk.yellow('Examples:')}
93
+ pgsql parse query.sql
94
+ pgsql parse query.sql -o ast.json
95
+ pgsql parse query.sql --format json --clean
96
+ `);
97
+ }
98
+ function showDeparseHelp() {
99
+ console.log(`
100
+ ${chalk.bold('pgsql deparse')} - Convert AST to SQL
101
+
102
+ ${chalk.yellow('Usage:')}
103
+ pgsql deparse [options]
104
+
105
+ ${chalk.yellow('Options:')}
106
+ -i, --input <file> Input JSON file (or use stdin)
107
+ -o, --output <file> Output to file instead of stdout
108
+ -h, --help Show help
109
+
110
+ ${chalk.yellow('Examples:')}
111
+ pgsql deparse -i ast.json
112
+ pgsql deparse -i ast.json -o query.sql
113
+ cat ast.json | pgsql deparse
114
+ pgsql parse query.sql | pgsql deparse
115
+ `);
116
+ }
117
+ function showProtoGenHelp() {
118
+ console.log(`
119
+ ${chalk.bold('pgsql proto-gen')} - Generate TypeScript from protobuf
120
+
121
+ ${chalk.yellow('Usage:')}
122
+ pgsql proto-gen --inFile <proto> --outDir <dir> [options]
123
+
124
+ ${chalk.yellow('Required Options:')}
125
+ --inFile <file> Input .proto file
126
+ --outDir <dir> Output directory
127
+
128
+ ${chalk.yellow('Optional Flags:')}
129
+ --enums Generate TypeScript enums
130
+ --enums-json Generate JSON enum mappings
131
+ --types Generate TypeScript interfaces
132
+ --utils Generate utility functions
133
+ --ast-helpers Generate AST helper methods
134
+ --wrapped-helpers Generate wrapped AST helpers
135
+ --optional Make all fields optional
136
+ --keep-case Keep original field casing
137
+ --remove-undefined Remove UNDEFINED enum at position 0
138
+ -h, --help Show help
139
+
140
+ ${chalk.yellow('Examples:')}
141
+ pgsql proto-gen --inFile pg_query.proto --outDir out --types --enums
142
+ pgsql proto-gen --inFile pg_query.proto --outDir out --types --utils --ast-helpers
143
+ pgsql proto-gen --inFile pg_query.proto --outDir out --types --optional --keep-case
144
+ `);
145
+ }
146
+ function showProtoFetchHelp() {
147
+ console.log(`
148
+ ${chalk.bold('pgsql proto-fetch')} - Download and process proto files
149
+
150
+ ${chalk.yellow('Usage:')}
151
+ pgsql proto-fetch [options]
152
+
153
+ ${chalk.yellow('Options:')}
154
+ --url <url> Proto file URL to download
155
+ --inFile <file> Where to save the proto file
156
+ --outFile <file> Generated JS output file
157
+ --replace-pkg <old> Original package name to replace
158
+ --with-pkg <new> New package name
159
+ -h, --help Show help
160
+
161
+ ${chalk.yellow('Examples:')}
162
+ pgsql proto-fetch --url https://raw.githubusercontent.com/pganalyze/libpg_query/16-latest/protobuf/pg_query.proto \\
163
+ --inFile pg_query.proto \\
164
+ --outFile pg_query.js \\
165
+ --replace-pkg "protobufjs/minimal" \\
166
+ --with-pkg "@launchql/protobufjs/minimal"
167
+ `);
168
+ }
169
+ function showRuntimeSchemaHelp() {
170
+ console.log(`
171
+ ${chalk.bold('pgsql runtime-schema')} - Generate runtime schema for AST nodes
172
+
173
+ ${chalk.yellow('Usage:')}
174
+ pgsql runtime-schema --inFile <proto> --outDir <dir> [options]
175
+
176
+ ${chalk.yellow('Required Options:')}
177
+ --inFile <file> Input .proto file
178
+ --outDir <dir> Output directory
179
+
180
+ ${chalk.yellow('Optional Options:')}
181
+ --format <format> Output format: json, typescript (default: json)
182
+ --filename <name> Output filename (default: runtime-schema)
183
+ -h, --help Show help
184
+
185
+ ${chalk.yellow('Examples:')}
186
+ pgsql runtime-schema --inFile pg_query.proto --outDir out
187
+ pgsql runtime-schema --inFile pg_query.proto --outDir out --format typescript
188
+ pgsql runtime-schema --inFile pg_query.proto --outDir out --filename ast-schema
189
+ `);
190
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const minimist_1 = __importDefault(require("minimist"));
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const parse_1 = require("./commands/parse");
10
+ const deparse_1 = require("./commands/deparse");
11
+ const proto_gen_1 = require("./commands/proto-gen");
12
+ const proto_fetch_1 = require("./commands/proto-fetch");
13
+ const runtime_schema_1 = require("./commands/runtime-schema");
14
+ const help_1 = require("./utils/help");
15
+ const argv = (0, minimist_1.default)(process.argv.slice(2), {
16
+ alias: {
17
+ h: 'help',
18
+ v: 'version',
19
+ o: 'output',
20
+ f: 'format'
21
+ }
22
+ });
23
+ const command = argv._[0];
24
+ async function main() {
25
+ try {
26
+ if (argv.version) {
27
+ (0, help_1.showVersion)();
28
+ process.exit(0);
29
+ }
30
+ if (!command || argv.help) {
31
+ (0, help_1.showHelp)(command);
32
+ process.exit(0);
33
+ }
34
+ switch (command) {
35
+ case 'parse':
36
+ await (0, parse_1.parseCommand)(argv);
37
+ break;
38
+ case 'deparse':
39
+ await (0, deparse_1.deparseCommand)(argv);
40
+ break;
41
+ case 'proto-gen':
42
+ await (0, proto_gen_1.protoGenCommand)(argv);
43
+ break;
44
+ case 'proto-fetch':
45
+ await (0, proto_fetch_1.protoFetchCommand)(argv);
46
+ break;
47
+ case 'runtime-schema':
48
+ await (0, runtime_schema_1.runtimeSchemaCommand)(argv);
49
+ break;
50
+ default:
51
+ console.error(chalk_1.default.red(`Unknown command: ${command}`));
52
+ (0, help_1.showHelp)();
53
+ process.exit(1);
54
+ }
55
+ }
56
+ catch (error) {
57
+ console.error(chalk_1.default.red('Error:'), error.message || error);
58
+ process.exit(1);
59
+ }
60
+ }
61
+ main();
@@ -0,0 +1 @@
1
+ export declare function readAndParsePackageJson(): any;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readAndParsePackageJson = readAndParsePackageJson;
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
6
+ // need to search due to the dist/ folder and src/, etc.
7
+ function findPackageJson(currentDir) {
8
+ const filePath = (0, path_1.join)(currentDir, 'package.json');
9
+ // Check if package.json exists in the current directory
10
+ if ((0, fs_1.existsSync)(filePath)) {
11
+ return filePath;
12
+ }
13
+ // Get the parent directory
14
+ const parentDir = (0, path_1.dirname)(currentDir);
15
+ // If reached the root directory, package.json is not found
16
+ if (parentDir === currentDir) {
17
+ throw new Error('package.json not found in any parent directory');
18
+ }
19
+ // Recursively look in the parent directory
20
+ return findPackageJson(parentDir);
21
+ }
22
+ function readAndParsePackageJson() {
23
+ // Start searching from the current directory
24
+ const pkgPath = findPackageJson(__dirname);
25
+ // Read and parse the package.json
26
+ const str = (0, fs_1.readFileSync)(pkgPath, 'utf8');
27
+ const pkg = JSON.parse(str);
28
+ return pkg;
29
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@pgsql/cli",
3
+ "version": "1.30.0",
4
+ "description": "Unified CLI for PostgreSQL AST parsing, deparsing, and code generation",
5
+ "author": "Dan Lynch <pyramation@gmail.com>",
6
+ "main": "index.js",
7
+ "module": "esm/index.js",
8
+ "types": "index.d.ts",
9
+ "homepage": "https://github.com/launchql/pgsql-parser/tree/master/packages/pgsql-cli#readme",
10
+ "license": "SEE LICENSE IN LICENSE",
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/launchql/pgsql-parser"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/launchql/pgsql-parser/issues"
20
+ },
21
+ "bin": {
22
+ "pgsql": "index.js"
23
+ },
24
+ "scripts": {
25
+ "copy": "copyfiles -f ../../LICENSE README.md package.json dist",
26
+ "clean": "rimraf dist",
27
+ "prepare": "npm run build",
28
+ "build": "npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
29
+ "build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
30
+ "dev": "ts-node src/index",
31
+ "lint": "eslint . --fix",
32
+ "test": "jest",
33
+ "test:watch": "jest --watch"
34
+ },
35
+ "keywords": [
36
+ "sql",
37
+ "postgres",
38
+ "postgresql",
39
+ "pg",
40
+ "query",
41
+ "ast",
42
+ "proto",
43
+ "parser",
44
+ "deparser",
45
+ "database"
46
+ ],
47
+ "dependencies": {
48
+ "@launchql/protobufjs": "7.2.6",
49
+ "@launchql/protobufjs-cli": "1.1.5",
50
+ "chalk": "^4.1.0",
51
+ "glob": "8.0.3",
52
+ "minimist": "1.2.8",
53
+ "mkdirp": "3.0.1",
54
+ "nested-obj": "^0.0.1",
55
+ "pg-proto-parser": "^1.29.0",
56
+ "pgsql-deparser": "^17.7.0",
57
+ "pgsql-parser": "^17.6.0"
58
+ },
59
+ "gitHead": "e0f9b0579328f4206c315d499e0e2045d3b8f845"
60
+ }
@@ -0,0 +1,2 @@
1
+ export declare function showVersion(): void;
2
+ export declare function showHelp(command?: string): void;