

def to_sql(self, connection, grammar):
    '\n        Get the raw SQL statements for the blueprint.\n\n        :param connection: The connection to use\n        :type connection: orator.connections.Connection\n\n        :param grammar: The grammar to user\n        :type grammar: orator.schema.grammars.SchemaGrammar\n\n        :rtype: list\n        '
    self._add_implied_commands()
    statements = []
    for command in self._commands:
        method = ('compile_%s' % command.name)
        if hasattr(grammar, method):
            sql = getattr(grammar, method)(self, command, connection)
            if (sql is not None):
                if isinstance(sql, list):
                    statements += sql
                else:
                    statements.append(sql)
    return statements

dataset/ETHPy150Open sdispater/orator/orator/schema/blueprint.py Blueprint.to_sql/original