Beispiel #1
0
    def _parse_column_name(self, column_name):
        """Parse a column name to make sure we quote resrerved words
        """

        if not storm_compile.is_reserved_word(column_name):
            return column_name

        return '"{}"'.format(column_name.replace('"', '""'))
Beispiel #2
0
    def _parse_column_name(self, column_name):
        """Parse a column name to make sure we quote resrerved words
        """

        if not storm_compile.is_reserved_word(column_name):
            return column_name

        return '"{}"'.format(column_name.replace('"', '""'))
Beispiel #3
0
def compile_sql_token_mysql(compile, expr, state):
    """MySQL uses ` as the escape character by default."""
    if is_safe_token(expr) and not compile.is_reserved_word(expr):
        return expr
    return '`%s`' % expr.replace('`', '``')
Beispiel #4
0
def is_sql_identifier(identifier):
    return (not expr_compile.is_reserved_word(identifier) and
            is_safe_token(identifier))
Beispiel #5
0
def compile_sql_token_mysql(compile, expr, state):
    """MySQL uses ` as the escape character by default."""
    if is_safe_token(expr) and not compile.is_reserved_word(expr):
        return expr
    return '`%s`' % expr.replace('`', '``')
Beispiel #6
0
def is_sql_identifier(identifier):
    return (not expr_compile.is_reserved_word(identifier) and
            is_safe_token(identifier))