Build it and they will come: JetBrains gets grip on MongoDB with v2020.3 of database IDE

Build it and they will come: JetBrains gets grip on MongoDB with v2020.3 of database IDE

While an IDE for database or SQL programmers might sound weird at first, it actually can be pretty useful. JetBrains’ DataGrip is such a tool and is now available in version 2020.3.

Maksim Sobolevskiy, product marketing manager at DataGrip, recounts the genesis of the programming environment in a call with DevClass as follows. “In nearly every project you have databases. That’s why we first added SQL support to our other IDEs, so you don’t need to switch the application [..] to see what’s going on there [in the database]. 

“And just at one moment, we understood [..] if we have already built the database support, which is pretty decent, maybe it can be useful for those who only work with databases.”

Those deliberations happened about five years ago and resulted in SQL development environment DataGrip. However, getting to this point wasn’t without its challenges, since SQL isn’t exactly like any of the other languages covered in JetBrains’ portfolio. “You don’t have the project, you don’t have the strong connections between modules and classes and whatever, you just write the query, and it’s pretty isolated,” noted Sobolevskiy, who is an SQL developer himself.

“To have the full IDE experience, we just changed a little bit how SQL tooling works. The main difference between DataGrip and all the other tools is that DataGrip actually caches your database and stores your database source codes on the disc, which actually helps us to understand all the connections. And that’s why we provide the code completion and coding assistance pretty fast, and it’s more or less smart, because we already know what it is you need.”

For the freshly released 2020.3 version, the DataGrip team ventured out a bit and turned its sights on NoSQL database MongoDB. Though widely spread, the tool can be a bit tricky to handle for those with a purely SQL background, since it comes with its own querying language MQL. However, it also allows the use of JavaScript via drivers, which is what JetBrains now tapped into. The latest DataGrip version comes with a JS-SQL translator that lets its users query MongoDB databases with the familiar SQL and turns it into something more understandable for the database.

“SQL is a much shorter language. I mean, you can write pretty small queries, and if you have to do the same in JavaScript, it will be like five times bigger. [..] Just to compare, we have this special button to see the JavaScript which will be actually run. [..] So we hope that this will help people to adopt MongoDB easier for those who want to do this. And just, if somebody likes SQL more, it’s possible to use that.” 

Not all queries are supported yet though, and the full list can be found on the DataGrip blog.

As Sobolevskiy mentioned, DataGrip relies on cached objects for the support it provides. Since this doesn’t necessarily reflect the current state of the database, the IDE now not only warns if a view, routine or function has been changed but also if a table differs or an object was deleted. In case the introspection step that retrieves database information to help its users goes awry for other reasons, the team has added steps to get and prepare diagnostics which can be passed on to support.

Version 2020.3 also includes new extractors to copy a column to a comma-separated string and generate an SQL INSERT statement with the multiple new rows that will be inserted. Console outputs can again be displayed in a separate tab and the IDE will display warnings if a script contains schema switches or the default schema if just a data source is chosen as a target. Examples for useful coding assistance additions are enhanced inline renaming options, typo fixes, and inspections for call conflicts in Oracle.

Other than that the new release answers the request for Couchbase support by launching capabilities to let users work with the Couchbase Query service (not to be confused with Couchbase Analytics). It is also the first version to allow developers to use Azure AD for authentication, and provides ways to specify the working directory for the process that handles data source operations, as well as to directly open files into a preview tab.

In terms of usability, DataGrip has caught up with the other JetBrain IDEs to some extent, letting users drag and drop tabs and split the editor horizontally or vertically, sync their IDE theme with the settings of their operating system, and enable or disable plugins for a current project. The IDE can now also be associated with certain types of files, and devs who have trouble getting their mental arithmetics right on Monday mornings can type simple math formulas into the search bar for help.