def to_sql(self, connection, grammar):
        """
        Get the raw SQL statements for the blueprint.

        :param connection: The connection to use
        :type connection: orator.connections.Connection

        :param grammar: The grammar to user
        :type grammar: orator.schema.grammars.SchemaGrammar

        :rtype: list
        """
        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