Ejemplo n.º 1
0
def compile_sql_token_oracle(compile, expr, state):
    # this is a simple hack to make sure all auto-generated aliases
    # get escaped; I added this if because oracle was complaining of
    # stuff such as money."value", that was being generated;
    if state.context in (TABLE, COLUMN_PREFIX, COLUMN, COLUMN_NAME, EXPR):
        if expr.startswith('_'):
            return '"%s"' % (expr)
        return expr

    if "." in expr and state.context in (TABLE, COLUMN_PREFIX):
        return ".".join(
            compile_sql_token(compile, subexpr, state)
            for subexpr in expr.split("."))
    return compile_sql_token(compile, expr, state)
Ejemplo n.º 2
0
def compile_sql_token_postgres(compile, expr, state):
    if "." in expr and state.context in (TABLE, COLUMN_PREFIX):
        return ".".join(compile_sql_token(compile, subexpr, state)
                        for subexpr in expr.split("."))
    return compile_sql_token(compile, expr, state)
Ejemplo n.º 3
0
def compile_sql_token_postgres(compile, expr, state):
    if "." in expr and state.context in (TABLE, COLUMN_PREFIX):
        return ".".join(
            compile_sql_token(compile, subexpr, state)
            for subexpr in expr.split("."))
    return compile_sql_token(compile, expr, state)