Revision 2587
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
7 | 7 |
import strings |
8 | 8 |
import util |
9 | 9 |
|
10 |
##### Escaping
|
|
10 |
##### Names
|
|
11 | 11 |
|
12 |
identifier_max_len = 64 # for both PostgreSQL and MySQL |
|
13 |
|
|
14 |
def add_suffix(str_, suffix): |
|
15 |
return strings.add_suffix(str_, suffix, identifier_max_len) |
|
16 |
|
|
12 | 17 |
def is_safe_name(name): |
13 | 18 |
'''A name is safe *and unambiguous* if it: |
14 | 19 |
* contains only *lowercase* word (\w) characters |
Also available in: Unified diff
sql_gen.py: Added identifier_max_len and add_suffix()