MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / quote_ident

Function quote_ident

web/pgadmin/static/js/utils.js:179–197  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

177}
178
179export function quote_ident(value) {
180 /* check if the string is number or not */
181 let quoteIt = false;
182 if (!isNaN(parseInt(value))){
183 quoteIt = true;
184 }
185
186 if(value.search(/[^a-z0-9_]/g) > -1) {
187 /* escape double quotes */
188 value = value.replace(/"/g, '""');
189 quoteIt = true;
190 }
191
192 if(quoteIt) {
193 return `"${value}"`;
194 } else {
195 return value;
196 }
197}
198
199export function fully_qualify(pgBrowser, data, item) {
200 const parentData = pgBrowser.tree.getTreeNodeHierarchy(item);

Callers 2

fully_qualifyFunction · 0.85

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected