Project

General

Profile

« Previous | Next » 

Revision 2587

sql_gen.py: Added identifier_max_len and add_suffix()

View differences:

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