Revision 2388
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
12 | 12 |
class MockDb: |
13 | 13 |
def esc_value(self, value): return repr(value) |
14 | 14 |
|
15 |
def esc_name(self, name): return name
|
|
15 |
def esc_name(self, name): return sql.esc_name_by_module(None, name)
|
|
16 | 16 |
mockDb = MockDb() |
17 | 17 |
|
18 | 18 |
class Code(objects.BasicObject): |
lib/sql.py | ||
---|---|---|
105 | 105 |
+'" may contain only alphanumeric characters and _') |
106 | 106 |
|
107 | 107 |
def esc_name_by_module(module, name, ignore_case=False): |
108 |
if module == 'psycopg2': |
|
108 |
if module == 'psycopg2' or module == None:
|
|
109 | 109 |
if ignore_case: |
110 | 110 |
# Don't enclose in quotes because this disables case-insensitivity |
111 | 111 |
check_name(name) |
Also available in: Unified diff
sql.py: esc_name_by_module(): Support module value None, and use default module psycopg2 for it