Revision 645
Added by Aaron Marcuse-Kubitza almost 13 years ago
sql.py | ||
---|---|---|
38 | 38 |
|
39 | 39 |
def esc_name(db, name): |
40 | 40 |
module = util.root_module(db) |
41 |
if module == 'psycopg2': quote = '"' |
|
41 |
if module == 'psycopg2': return name |
|
42 |
# Don't enclose in quotes because this disables case-insensitivity |
|
42 | 43 |
elif module == 'MySQLdb': quote = '`' |
43 |
else: raise NotImplementedError("Can't escape names for "+module+ |
|
44 |
' database') |
|
44 |
else: raise NotImplementedError("Can't escape name for "+module+' database') |
|
45 | 45 |
return quote + name.replace(quote, '') + quote |
46 | 46 |
|
47 | 47 |
def run_query(db, query, params=None): |
Also available in: Unified diff
sql.py: Don't enclose PostgreSQL names in quotes because this disables case-insensitivity