Get SQL Statement

I’m using

                $dataProvider = new SqlDataProvider([
                    'sql' => $SQL,
                    'pagination' => false,
                    'params' => $params,
                ]);

Is there a way to get the generate SQL Statement that Yii uses based on the sql and params?

If that’s for debugging, it’s https://github.com/yiisoft/yii2/blob/master/framework/data/SqlDataProvider.php#L137, replace queryAll() with getRawSql().

1 Like

Thank you.