DataGrip plugin?

Issue #1820 resolved
Mark Mindenhall created an issue

Hi,

Given that Illuminated Cloud has nice support for SOQL queries (including syntax highlighting, etc), would it be possible to also provide a DataGrip plugin? I think you could sell those licenses separately from Illuminated Cloud (although it would be appreciated if it was included with an IC license), and I know you’d probably sell a few to folks in my company.

It’s currently possible to query Salesforce data (instructions here) from DataGrip, but there’s no “dialect” for SOQL. A plugin that included the JDBC driver and the “dialect” (syntax highlighting, hints, error detection and so forth) would be awesome! I think most of the hard work has already been done for the SOQL support within IC.

Thanks!

Comments (6)

  1. Scott Wells repo owner

    Hi, Mark. Is the question whether it would be possible to add support for DataGrip to IC2 just as it currently supports IntelliJ IDEA, WebStorm, RubyMine, etc., or is it whether it would be possible to extract just the SOQL features of IC2 and add them to DataGrip? If the former, it's very possible, though I haven't had any requests (prior to this) for such support. If the latter, though, probably not. The SOQL features are so intrinsically tied together with many of the IDE features--in particular Apex since the SOQL grammar is effectively a subset of the Apex grammar--that it would be a tremendous amount of work to extract and repurpose it.

  2. Mark Mindenhall reporter

    Hi Scott! DataGrip looks like any other JetBrains IDE – it’s just specific for working on databases. There are a lot of plugins that can be installed in DataGrip that are also available in other JetBrains IDEs, so perhaps it would be possible to install IC2, and then configure it to disable Apex support while leaving SOQL support in place?

  3. Scott Wells repo owner

    Hi, Mark. Yes, I'm familiar with DataGrip. My question was more around what you're requesting, specifically whether you're requesting that IC2 be available in DataGrip as-is or that some other IC2-derived plugin provide a first-class support for DataGrip's notion of query languages. The former is actually not hard...the real concern is that this is the only request I've had for it, and every additional supported JetBrains IDE adds to the overall test/support matrix. The latter is a completely new product, though, and it's what likely would add the most value in DataGrip. Make sense?

  4. Mark Mindenhall reporter

    Hi Scott, sorry I wasn’t more clear! I definitely don’t think it makes sense for IC2 to be available in DataGrip “as is”. I was suggesting a new IC2-derived product rather than just a new IC2 plugin target.

    The reason for my suggestion is that other JetBrains products (IDEA, RubyMine, PyCharm, etc) are designed to write code first, and database querying is relegated to a secondary bottom panel. DataGrip is designed for data querying first, and provides a much better experience. So I was asking whether it would be possible to create an IC2-derived experience for executing Salesforce queries within DataGrip (similar to how I can now execute queries against Postgres, MongoDB, etc).

    BTW, in my initial request I linked to a StackOverflow answer on how to configure DataGrip to query Salesforce using a free JDBC driver. I tried that out, and it does work for simple queries. For example:

    SELECT Id, Name FROM Course__c LIMIT 100
    

    However, when I tried to query across a related object, I got an error:

    SELECT Id, Name, Opportunity__r.Name FROM Course__c LIMIT 100
    

    The error message complains that there’s no Opportunity__r table or alias referenced in the FROM clause. I suspect that this error is coming from the IDE rather than the driver, but I’m not certain just yet. I’ll need to try the same query from some Java or Kotlin code to be sure.

  5. Scott Wells repo owner

    Okay, that helps to clarify it. So quite a few years back I played with the DataDirect JDBC driver for Salesforce, and I'm pretty certain that the JDBC driver from relier soft likely works the same way. Basically they transpile SQL queries to SOQL queries for purposes of execution, then marshal the SOQL result sets into SQL result sets. That's why SOQL relationship queries don't work. You'd need to translate them into the corresponding standard SQL joins. Similarly, it translates SQL DDL statements (insert, update, delete) into Salesforce DDL commands since SOQL is by design a read-only query language and doesn't support DDL. Instead DDL is executed in Apex or via the Salesforce APIs.

    DataGrip is fundamentally a SQL tool, and while it can support very sophisticated dialects of SQL--and perhaps even some object-oriented derivatives such as HQL and JOQL--it's really designed for use with SOQL. I'm not sure exactly what would be involved in trying to add true first-class support for SOQL, or if it's even possible, but my guess is that if it is possible, it would be a pretty significant undertaking that would share very little with IC2's code base.

    I do like the idea, but at this point IC2 pretty much consumes all of my time. I'll keep this open as a proposal, but in all honesty, I think it's very unlikely I'll get to it unless I find a quite simple way to support it. To be fair, I said that same thing recently about SAQL support in IC2 and actually did find a very lightweight way to provide reasonable support, so there's always a chance.

  6. Log in to comment