Diagrams for queries

While visualizing relationships between database tables is quite a convenient feature, PyCharm further offers the ability to create diagrams for your queries:

  1. For example, in your SQLite console, enter the following query that asks for the title of each album in our database as well as its corresponding artist:
SELECT a.Title, ar.Name FROM Album a, Artist ar WHERE a.ArtistId = ar.ArtistId;
  1. Within the console, right-click on the command you just entered, and select Explain Plan. Doing this will open a new tab in the Database Console panel named Plan.
  2. From this tab, click on the Show Visualization button within the toolbar on the left of the tab, and you should obtain the following diagram the corresponds to our query:

Visualization of a query plan

With this ability to visualize the logic of a query, which is especially valuable for reporting purposes, PyCharm makes working with SQL commands significantly more intuitive. Similar to what we saw with other diagrams, we can also print or export this visualization to a file using the corresponding toolbar.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.72.78