Comments (6)
There's a setting called "Identifiers case", but if I change that to lower it will also format the parameters and function/procedure/cursor names.
That's correct. Function names, procedure names, cursor names, variable names, synonym names, table names, view names, column names etc. are all identifiers. So this setting works as expected.
There is no setting to change the case for table/view names only.
from plsql-formatter-settings.
Hi @PhilippSalvisberg, thanks for your response.
Do you know if there's any other way of achieving it?
Using an external tool or something else?
from plsql-formatter-settings.
Do you know if there's any other way of achieving it?
Using an external tool or something else?
IMO everything is possible. But it's not that easy. In various cases, you cannot distinguish between a view, table, synonym or function. Here's an example:
select * from x;
In this case x
can be a table, a view, a synonym or even a function.
If you want to change the case of views and tables only, you need a tooling that provides semantic information such as PL/Scope. So, it's possible. You could even implement that using Arbori by querying the PL/Scope data (if available) from a callback function. However, this would make the formatter unbearable slow.
from plsql-formatter-settings.
@mmunoz-mic I understand you are using camelCase for function, parameter, and cursor names and would like to preserve them. You would like to change TABLE_1
, TABLE_2
and TABLE_3
to lowercase.
What about changing all identifiers to lowercase if they are in uppercase? This could be a single Arbori rule at the end of your formatter. This should produce the result you want. Changing all identifiers to lowercase while preserving existing identifiers in camelCase.
from plsql-formatter-settings.
Sorry for the late response, I've been out of office.
I understand the implications this would have in performance in the formatter.
I think I can work something out with regex to do the identifier case fix after the formatter.
I'd love to have everything in lowercase but this is used in a corporate environment and camelCase is used for function, parameter, cursor, package and types identifiers.
from plsql-formatter-settings.
As mentioned before, you can achieve what you want with Arbori. Look at i11_enforce_nonquoted_identifiers that is also updating the token stream. It should be more reliable than a RegEx-based solution because you can easily find relevant identifiers.
We will not include such a feature in the formatter provided in this repo. Therefore I'm closing this issue.
from plsql-formatter-settings.
Related Issues (20)
- Package constant formatting HOT 1
- Function header formatting: return deterministic HOT 1
- Support SQLDev 23.1.0 HOT 1
- Add - Formatierung "CASE WHEN" in SELECT statemen HOT 4
- Newlines being inserted into strings HOT 5
- Concatenation Bars being split apart invalidating strings HOT 2
- compiler flag concatenated to same line as end statement HOT 2
- Support SQLcl 23.3
- Do not reset Arbori program when importing trivadis_advanced_format.xml
- Unwanted line break after `whenever oserror` breaks code
- Wrong indentation in subqueries of with_clause in insert statements
- Unwanted line break before `on conversion error` in subquery
- spaces removed in grant statement
- Patching SQL Developer breaks Script Output tab feedback of direct SQL statement execution HOT 8
- Support SQLcl 23.4.0
- Can't export data after patch HOT 2
- Connection window is empty and not able to create any new database connection HOT 4
- Double quotes removed from xmlelement after format. HOT 2
- tvdformat.jar doesn't work with Java 22 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plsql-formatter-settings.