@dwtechs/antity-pgsql 0.2.1 → 0.3.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.
- package/dist/antity-pgsql.js +15 -1
- package/package.json +1 -1
package/dist/antity-pgsql.js
CHANGED
|
@@ -147,8 +147,22 @@ function deleteIdleProperties(res) {
|
|
|
147
147
|
res._prebuiltEmptyResultObject = undefined;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
const reserved = [
|
|
151
|
+
'all', 'analyse', 'analyze', 'and', 'any', 'array', 'as', 'asc', 'asymmetric',
|
|
152
|
+
'authorization', 'between', 'binary', 'both', 'case', 'cast', 'check', 'collate',
|
|
153
|
+
'column', 'constraint', 'create', 'cross', 'current_catalog', 'current_date',
|
|
154
|
+
'current_role', 'current_schema', 'current_time', 'current_timestamp', 'current_user',
|
|
155
|
+
'default', 'deferrable', 'desc', 'distinct', 'do', 'else', 'end', 'except', 'false',
|
|
156
|
+
'fetch', 'for', 'foreign', 'from', 'full', 'grant', 'group', 'having', 'ilike', 'in',
|
|
157
|
+
'initially', 'inner', 'intersect', 'into', 'is', 'isnull', 'join', 'lateral', 'leading',
|
|
158
|
+
'left', 'like', 'limit', 'localtime', 'localtimestamp', 'natural', 'not', 'notnull',
|
|
159
|
+
'null', 'offset', 'on', 'only', 'or', 'order', 'outer', 'overlaps', 'placing', 'primary',
|
|
160
|
+
'references', 'returning', 'right', 'select', 'session_user', 'similar', 'some', 'symmetric',
|
|
161
|
+
'table', 'tablesample', 'then', 'to', 'trailing', 'true', 'union', 'unique', 'user', 'using',
|
|
162
|
+
'variadic', 'verbose', 'when', 'where', 'window', 'with'
|
|
163
|
+
];
|
|
150
164
|
function quoteIfUppercase(word) {
|
|
151
|
-
if (/[A-Z]/.test(word))
|
|
165
|
+
if (/[A-Z]/.test(word) || reserved.includes(word.toLowerCase()))
|
|
152
166
|
return `"${word}"`;
|
|
153
167
|
return word;
|
|
154
168
|
}
|