How to display raw sql query of a views in Drupal 8?
To see views SQL query, you can use hook_views_pre_execute(ViewExecutable $view)
Use __toString() with query to return raw SQL query.
To see views SQL query, you can use hook_views_pre_execute(ViewExecutable $view)
function hook_views_pre_execute(ViewExecutable $view) { print_r($view->query->query()->__toString()); die(); }
Use __toString() with query to return raw SQL query.
Comments
Post a Comment