Revision 2932
Added by Aaron Marcuse-Kubitza about 12 years ago
sql_gen.py | ||
---|---|---|
16 | 16 |
|
17 | 17 |
identifier_max_len = 63 # works for both PostgreSQL and MySQL |
18 | 18 |
|
19 |
def add_suffix(str_, suffix):
|
|
19 |
def concat(str_, suffix):
|
|
20 | 20 |
'''Preserves version so that it won't be truncated off the string, leading |
21 | 21 |
to collisions.''' |
22 | 22 |
# Preserve version |
... | ... | |
25 | 25 |
str_ = before |
26 | 26 |
suffix = sep+version+suffix |
27 | 27 |
|
28 |
return strings.add_suffix(str_, suffix, identifier_max_len)
|
|
28 |
return strings.concat(str_, suffix, identifier_max_len)
|
|
29 | 29 |
|
30 |
def truncate(str_): return add_suffix(str_, '')
|
|
30 |
def truncate(str_): return concat(str_, '')
|
|
31 | 31 |
|
32 | 32 |
def is_safe_name(name): |
33 | 33 |
'''A name is safe *and unambiguous* if it: |
Also available in: Unified diff
strings.py, sql_gen.py: Renamed add_suffix() to concat() to reflect that this is a fixed-length replacement for +