DataGrip
 
2023.1
Get DataGrip
You are viewing the documentation for an earlier version of DataGrip.

Virtual views

Last modified: 21 December 2022

If you need to monitor the result set of a certain SQL statement that you run regularly, use a virtual view. Virtual view lets you have the result set available in the Database Explorer, and that data will not be stored in the database.

For a virtual view, apart from SELECT queries, you can also use statements like show processlist for MySQL or exec sp_who2 for Microsoft SQL Server.

For example, to have a list of current database connections for a PostgreSQL database, create a virtual view with the following query:

The virtual view with the result set of your query will be available in the Database Explorer as a virtual object.

Virtual view

Virtual views can be seen in the Database Explorer. You can see a reference on node and object icons in the Icons for data sources and their elements chapter of Database Explorer topic.