MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / quoteChar

Function quoteChar

modules/dasSQLITE/sqlite/shell.c:1003–1010  ·  view source on GitHub ↗

** Attempt to determine if identifier zName needs to be quoted, either ** because it contains non-alphanumeric characters, or because it is an ** SQLite keyword. Be conservative in this estimate: When in doubt assume ** that quoting is required. ** ** Return '"' if quoting is required. Return 0 if no quoting is required. */

Source from the content-addressed store, hash-verified

1001** Return '"' if quoting is required. Return 0 if no quoting is required.
1002*/
1003static char quoteChar(const char *zName){
1004 int i;
1005 if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"';
1006 for(i=0; zName[i]; i++){
1007 if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"';
1008 }
1009 return sqlite3_keyword_check(zName, i) ? '"' : 0;
1010}
1011
1012/*
1013** Construct a fake object name and column list to describe the structure

Callers 6

shellFakeSchemaFunction · 0.85
shellAddSchemaNameFunction · 0.85
shell_callbackFunction · 0.85
set_table_nameFunction · 0.85
dump_callbackFunction · 0.85
do_meta_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected