Revision 2784
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
212 | 212 |
self.result = [] |
213 | 213 |
|
214 | 214 |
def execute(self, query, params=None): |
215 |
assert params == None or params == [] or params == () |
|
215 | 216 |
if params == [] or params == (): params = None |
216 | 217 |
# None turns off the mogrifier |
217 | 218 |
|
... | ... | |
291 | 292 |
def run_query(self, query, params=None, cacheable=False, log_level=2, |
292 | 293 |
debug_msg_ref=None): |
293 | 294 |
''' |
295 |
@param params Not supported. Use self.esc_value() instead. |
|
294 | 296 |
@param log_ignore_excs The log_level will be increased by 2 if the query |
295 | 297 |
throws one of these exceptions. |
296 | 298 |
@param debug_msg_ref If specified, the log message will be returned in |
Also available in: Unified diff
sql.py: DbConn.DbCursor.execute(): Require that params are empty, to ensure that code uses db.esc_value() instead. This keeps literal values in the same place as the rest of the query, so that they do not need to be maintained and passed around separately in a params list.