Revision 2814
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
269 | 269 |
|
270 | 270 |
def esc_name(self, name): return esc_name(self, name) # calls global func |
271 | 271 |
|
272 |
def std_code(self, str_): |
|
273 |
'''Standardizes SQL code. |
|
274 |
* Ensures that string literals are prefixed by `E` |
|
275 |
''' |
|
276 |
if str_.startswith("'"): str_ = 'E'+str_ |
|
277 |
return str_ |
|
278 |
|
|
272 | 279 |
def can_mogrify(self): |
273 | 280 |
module = util.root_module(self.db) |
274 | 281 |
return module == 'psycopg2' |
Also available in: Unified diff
sql.py: DbConn: Added std_code()