Replies: 3 comments 2 replies
-
This might work, but what you'd be saying to the formatter to treat I think a better way would be to use the paramTypes config to define a custom rule to recognize parameters like that. Something like:
Or alternatively you could supply the
|
Beta Was this translation helpful? Give feedback.
-
Your suggestion to use BTW, had a minor issue building/running the project on nodejs 22.15.0 sql-formatter/bin$ npm run build
sql-formatter/bin$ echo "SQL HERE" | ./sql-formatter-cli.cjs -l plsql
Dist/cjs/package.json
# '{"type": "commonjs"}'
node:internal/modules/package_json_reader:145
const result = modulesBinding.getNearestParentPackageJSON(checkPath);
^
Error: Invalid package config \\?\sql-formatter\dist\cjs\package.json.
at Object.getNearestParentPackageJSON (node:internal/modules/package_json_reader:145:33)
at Object..js (node:internal/modules/cjs/loader:1883:29)
at Module.load (node:internal/modules/cjs/loader:1465:32)
at Function.\_load (node:internal/modules/cjs/loader:1282:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Module.require (node:internal/modules/cjs/loader:1487:12)
at require (node:internal/modules/helpers:135:16)
at Object.<anonymous> (\sql-formatter\bin\sql-formatter-cli.cjs:5:39)
at Module.\_compile (node:internal/modules/cjs/loader:1730:14) {
code: 'ERR_INVALID_PACKAGE_CONFIG'
} After each build, ...so based on the error we removed the enclosing Thank you again for your assistance! |
Beta Was this translation helpful? Give feedback.
-
I guess these extra quotes resulted from this build script in package.json:
But I don't know why that would happen. For me it works just fine. I tested with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We're using the plsql formatter for parsing Pro*C SQL. It's proprietary to Oracle but it's basically PL/SQL with some minor C-based spiciness sprinkled on top. The plsql formatter handles 99% of our needs except for statements containing array-based bind variables:
The same error is not raised, however, using TSQL formatter. After comparing the two formatters we believe
identTypes
parameter in<dialect>.formatter.ts
might be the cause as plsql does not have'[]'
like tsql does .We have not yet tested this solution - are we at least on the right path?
Beta Was this translation helpful? Give feedback.
All reactions