Revision 2588
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
406 | 406 |
|
407 | 407 |
##### Basic queries |
408 | 408 |
|
409 |
identifier_max_len = 64 # for both PostgreSQL and MySQL |
|
410 |
|
|
411 | 409 |
def next_version(name): |
412 | 410 |
version = 1 # first existing name was version 0 |
413 | 411 |
match = re.match(r'^(.*)#(\d+)$', name) |
414 | 412 |
if match: |
415 | 413 |
name, version = match.groups() |
416 | 414 |
version = int(version)+1 |
417 |
return strings.add_suffix(name, '#'+str(version), identifier_max_len)
|
|
415 |
return sql_gen.add_suffix(name, '#'+str(version))
|
|
418 | 416 |
|
419 | 417 |
def run_query_into(db, query, params, into=None, *args, **kw_args): |
420 | 418 |
'''Outputs a query to a temp table. |
Also available in: Unified diff
sql.py: next_version(): Use new sql_gen.add_suffix(). Removed identifier_max_len because it is now in sql_gen.