Drupal: Show SQL Query of the View

Working with Drupal views, is amazing isn’t it? Of course, if you have any experience with it. But in my future post, I will explain how to make a view and what is the usage of it in Drupal.

But in this post I am going to share a developer’s tip of the day.

How to preview SQL of the view?

Go to the /admin/structure/views/settings click the checkbox from Show the SQL query.

After you you checked the checkbox, SQL will be displayed in view edit page. In my case I am case I made a new view called “Articles” /admin/structure/views/view/articles

It’s quite useful most of the times, if you need to debug that how data is being fetched.

Author: Danyal
I'm a skilled programmer specializing in Vue.js/Nuxt.js for front-end development and PHP Laravel for back-end solutions. I have a strong focus on API design and development, complemented by experience in web server setup and maintenance. My versatile expertise ensures seamless creation and maintenance of web applications, covering everything from intuitive user interfaces to robust server-side functionality. Passionate about coding and driven by a lifelong learning mindset, I invite you to explore more at danyal.dk.