def validate(self, value):

        query = Query(sql=value)

        passes_blacklist, failing_words = query.passes_blacklist()

        error = MSG_FAILED_BLACKLIST % ', '.join(failing_words) if not passes_blacklist else None

        if not error and not query.available_params():
            try:
                query.execute_query_only()
            except DatabaseError as e:
                error = str(e)

        if error:
            raise ValidationError(
                _(error),
                code="InvalidSql"
            )
Ensure that the SQL passes the blacklist and executes. Execution check is skipped if params are present.
dataset/ETHPy150Open groveco/django-sql-explorer/explorer/forms.py/SqlField.validate