Drupal 8 - Show SQL query of Views

By xngo on June 26, 2019

In Drupal 8, by default, the SQL query of Views is not shown. For debugging purposes, it is good to enable it. Navigate to Structure > Views > Settings and then check Show the SQL query.

Setting to show SQL query

After that, you can see the SQL query of Views in the Preview section.

SQL query in preview section

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.