Skip to content

Commit 4671a99

Browse files
Make G-1050 less strict, closes #180
1 parent a8a6280 commit 4671a99

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/4-language-usage/1-general/g-1050.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ All constants should be collated in just one package used as a library. If these
1111

1212
In specific situations this rule could lead to an extreme plethora of constants, for example if you use Logger like `logger.append_param(p_params =>l_params, p_name => 'p_param1_todo', p_val => p_param1_todo);`, where the value for `p_name` always should be the name of the variable that is passed to `p_val`. For such cases it would be overkill to add constants for every single variable name you are logging, so if you use Logger or similar, consider making that an exception to the rule, just document exactly which exceptions you will allow and stick to them.
1313

14+
Another exception is literals in views. It is not possible to use constants there, and using functions to wrap constants can have a negative impact on performance when peeking at binding variables is essential for an optimal execution plan.
15+
16+
To reduce the number of false positives, the number of occurrences of a literal should be less than 3.
17+
1418
## Example (bad)
1519

1620
``` sql

0 commit comments

Comments
 (0)