Skip to content

Commit ca70cea

Browse files
committed
refactor: remove PL/pgSQL function parsing support
- Removed --pl flag from parse command - Removed PL/pgSQL references from help documentation - Simplified parse command to only handle standard SQL - PL/pgSQL parsing is not supported by the underlying parser
1 parent b009a17 commit ca70cea

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

packages/pgsql-cli/src/commands/parse.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@ export async function parseCommand(argv: any) {
2828
const content = readFileSync(filePath, 'utf-8');
2929

3030
// Parse SQL
31-
let ast;
32-
if (argv.pl) {
33-
// PL/pgSQL function parsing not yet supported in this version
34-
console.error(chalk.red('Error: PL/pgSQL function parsing (--pl) is not yet supported'));
35-
process.exit(1);
36-
} else {
37-
ast = await parse(content);
38-
}
31+
const ast = await parse(content);
3932

4033
// Clean AST if requested
4134
if (argv.clean) {

packages/pgsql-cli/src/utils/help.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,12 @@ ${chalk.yellow('Usage:')}
9090
${chalk.yellow('Options:')}
9191
-o, --output <file> Output to file instead of stdout
9292
-f, --format <format> Output format: json, pretty (default: pretty)
93-
--pl Parse as PL/pgSQL function only
9493
--clean Clean the AST tree (remove location info)
9594
-h, --help Show help
9695
9796
${chalk.yellow('Examples:')}
9897
pgsql parse query.sql
9998
pgsql parse query.sql -o ast.json
100-
pgsql parse function.sql --pl
10199
pgsql parse query.sql --format json --clean
102100
`);
103101
}

yarn.lock

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,9 +1325,9 @@
13251325
integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==
13261326

13271327
"@sinclair/typebox@^0.34.0":
1328-
version "0.34.35"
1329-
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.34.35.tgz#185c57551d5edf9a2f6e9d012822b06f942cfbfc"
1330-
integrity sha512-C6ypdODf2VZkgRT6sFM8E1F8vR+HcffniX0Kp8MsU8PIfrlXbNCBz0jzj17GjdmjTx1OtZzdH8+iALL21UjF5A==
1328+
version "0.34.36"
1329+
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.34.36.tgz#cbf53a007afa34e5f442b75888f9719f2ab463bb"
1330+
integrity sha512-JFHFhF6MqqRE49JDAGX/EPlHwxIukrKMhNwlMoB/wIJBkvu3+ciO335yDYPP3soI01FkhVXWnyNPKEl+EsC4Zw==
13311331

13321332
"@sinonjs/commons@^3.0.0":
13331333
version "3.0.1"
@@ -2500,7 +2500,7 @@ deep-is@^0.1.3, deep-is@~0.1.3:
25002500
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
25012501
integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==
25022502

2503-
[email protected], deepmerge@^4.2.2, deepmerge@^4.3.1:
2503+
[email protected], deepmerge@^4.2.2:
25042504
version "4.3.1"
25052505
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a"
25062506
integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==
@@ -3674,16 +3674,6 @@ inquirer@^8.2.4:
36743674
through "^2.3.6"
36753675
wrap-ansi "^6.0.1"
36763676

3677-
3678-
version "1.9.0"
3679-
resolved "https://registry.yarnpkg.com/inquirerer/-/inquirerer-1.9.0.tgz#108071773a28ea5b950271572ac3051f34e0c92e"
3680-
integrity sha512-/LAn/F70YvRQZWz9r1q1seoO2oRMiSCSK8xKHGlkNebSibx5FppUKZLEjXgkCy1tgccas933q/Y7qNccFxrYkw==
3681-
dependencies:
3682-
chalk "^4.1.0"
3683-
deepmerge "^4.3.1"
3684-
js-yaml "^4.1.0"
3685-
minimist "^1.2.8"
3686-
36873677
ip-address@^9.0.5:
36883678
version "9.0.5"
36893679
resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a"

0 commit comments

Comments
 (0)