Mixed feelings about datagrip
I've been using datagrip for a little while and I like some aspects of it... Ctrl+N in particular is really handy when trying to find where things live in the DB. And I like the dark theme. But I have a few niggles with it. And bear in mind this is someone coming from SQL Management Studio and Visual Studio.
1. My only real showstopper is to do with how datagrip executes queries. I get the impression that there's some logic in there to break a query up into chunks. However, sometimes Datagrip just will not run a query - I get a syntax error in a weird place that's actually fine. If I copy/paste the query elsewhere (e.g. into linqpad set to SQL) then it runs fine. I lost a lot of time with this until I realised it wasn't my fault. I think one occasion it was to do with a CASE statement in the columns of a SELECT statement. In another I was getting errors pointing at the wrong lines because I had very similar code across the file. (I was inserting some data which had very similar parts.) I've not had a chance to really sit down and try to figure out what the problem areas are but it's been deeply frustrating at times, and it's the kind of thing that would make me give up on DG.
2. I don't find the projects very intuitive. I'm not sure what I'm supposed to be doing with them. Yes I guess I can put a number of arbitrary scripts here but it doesn't feel useful. Instead my scripts are usually elsewhere and datagrip constantly complains about it. For me, Visual Studio DB projects make sense as a way to organise scripts for a DB. And Management Studio makes sense for using arbitrary scripts etc. But DG seems to sit awkwardly in the middle.
3. Sometimes I'm not sure if datagrip has actually executed my query or not. Maybe it's because it updates the results so smoothly. But I have had some occasions where I thought I was running the script and I don't think it was doing anything. (E.g. when altering a stored proc, I find the proc hasn't actually updated at all.) Is there a way to clear the results?
4. I can't seem to get to grips with the indentation. Can I control the formatting around BEGIN and END? I'd like to set it up like braces in C# (i.e. BEGIN and END line up with the control statement above them.) I've also set DG up to use tabs not spaces, but I'm sure it's putting in spaces itself anyway and then complains that I have mixed tabs and spaces. (This last one I need to check that it's the case.)
5. I find the whole "console" stuff a little confusing - maybe because I think in terms of queries and connections and console seems to be a bit of both. Sometimes I select the wrong DB and start a script, but then can't figure out how to change which console/connection/thingy it's using. Sure I can use "USE db" but it's not quite the same.
6. We use SQL logins a lot in dev for some reason. Which I have to set up individually for every single DB I use. And if my password changes then it's a total pain. Can I just set the credentials up once somewhere?
7. It's lacking a lot of script generation features from SQL Management Studio which lets me script everything. And I don't think it ever gives me a full picture of the schema.
8. And a couple of complaints I have with jetbrains IDEs in general. Firstly, upgrading to a major version is a pain. i just want to wipe the old one and replace the new one as I can with a patch release. I end up with all my shortcuts broken, and bits of the old apps hanging around.
9. It would be handy to be able to just set all my jetbrains stuff up the same way. I started with R# but none of the other IDEs use the same keyboard shortcuts. Sure I can track down the resharper JAR and use it for all the other ones. Individually. I don't get on with the darcula theme exactly as it is as the grey contrast isn't strong enough (I've not figured out how to change the IDE chrome colours yet though). So every jetbrains tool I need to go in, configure the colours, increase font size etc. Each time separately. I don't know when I install, say DG it can't say "import settings from r#" or from webstorm or wherever. This is a bit of a minor gripe but I've always found it odd.
Sorry, I do love jetbrains tools, but I'm finding it hard to feel the same affection for DataGrip. Here's hoping that it can mature rather quickly.
One other feature I would like is the ability to use a different Windows login for a connection as opposed to the current user. I'm guessing that no tools allow this as it's unusual and maybe not easy to do.
Please sign in to leave a comment.
Sorry forgot to add another little thing. When I first started datagrip I had no idea what to do with it. I ended up in data sources by mistake and got pretty confused. That's the first thing it tells me to do - but why? When would I ever go there? As far as I can tell, until you create a project the app is useless, but it doesn't make it obvious that that's what I need to do. It just starts weirdly empty.
Thanks for the feedback!
1.
> I get the impression that there's some logic in there to break a query up into chunks. However, sometimes Datagrip just will not run a query - I get a syntax error in a weird place that's actually fine.
Indeed. DataGrip by default executes the statement, which is detected under the caret. If there is an ambiguity, IDE should ask what statement to execute. You can execute the exact statement you want by selecting this code and invoking Execute action. This behavior is configured in File | Settings | Database | General -> Execute in Console section.
>I get a syntax error in a weird place that's actually fine
Could you attach such a sample snippet for which there was a syntax error reported?
2.
> Instead my scripts are usually elsewhere and datagrip constantly complains about it.
I see your point. Note that you can attach the directory where your scripts are located to the project.
3.
>Sometimes I'm not sure if datagrip has actually executed my query or not. Maybe it's because it updates the results so smoothly. But I have had some occasions where I thought I was running the script and I don't think it was doing anything. (E.g. when altering a stored proc, I find the proc hasn't actually updated at all.) Is there a way to clear the results?
The history of executed queries is shown in Output tab and can be cleared from the context menu. Does it help?
Also, there could be that the procedure was not instantly updated in Database too window (it should be, actually, already fixed in latest versions).
4.
> Can I control the formatting around BEGIN and END? I'd like to set it up like braces in C# (i.e. BEGIN and END line up with the control statement above them.)
Please vote for this request https://youtrack.jetbrains.com/issue/DBE-1772
5.
>Sometimes I select the wrong DB and start a script, but then can't figure out how to change which console/connection/thingy it's using.
You can assign colors for each data source to more easily distinguish them.
6.
> We use SQL logins a lot in dev for some reason. Which I have to set up individually for every single DB I use. And if my password changes then it's a total pain. Can I just set the credentials up once somewhere?
Currently it is not possible. Please vote for https://youtrack.jetbrains.com/issue/DBE-2083
7.
>It's lacking a lot of script generation features from SQL Management Studio which lets me script everything. And I don't think it ever gives me a full picture of the schema.
What shema object are missing? Sequences and triggers may not be visible there yet. We are working on a better DB instospection. What particular generation feature you miss? Please check also Compose statements
8.
>Firstly, upgrading to a major version is a pain. i just want to wipe the old one and replace the new one as I can with a patch release. I end up with all my shortcuts broken, and bits of the old apps hanging around.
Not all the updates can be performed with the patch (it is technically not possible or error-prone). This is also true for major version updates. If you are on Windows, the installer proposes you to de-install the old installation when you are installing a new one. For other OS you will need to manually delete the old installation - true. But when you start new version - there is a prompt asking if you want to copy the settings from previous installation, so that the settings are preserved.
9.
>Each time separately. I don't know when I install, say DG it can't say "import settings from r#" or from webstorm or wherever
Settings Import/Export between all IntelliJ platform-based products works (includign DG and WebStorm).
We have also been working on a tool which will help to to manage multiply JetBrains products installations from one place and are going to make it public soon. See some details in blog post's comments.
Thanks for the reply.
I have DataGrip set up to run the whole script, or the selection. I changed the default behaviour because I couldn't get on with it. But I think it still does break up the scripts to run them and doesn't do so reliably. I don't really want to submit the scripts that are wrong as they are our source and I've just not had the time to try to create a simple test to demonstrate the problem. I will try, but it does happen quite often.
Thanks re attaching a dir - I'll give that a go. But it still feels really clumsy. What is the point of a project? What's supposed to be in it?
I think the problem with knowing when something is executed is that, say in Linqpad or SQL Management Studio the output very obviously clears and restarts. It's not as smooth looking at DG but it's obvious that something's happened because it changes for a second.
I'm not sure assigning colours will be that useful. How do I change connection for an existing script? And when it asks me which console I want for the same connection - what's the difference? (Going back to my not really understanding what a "console" is in this instance?
Regarding schema object scripting - I'll have another try and make a note and maybe submit requests. But in SQL Management Studio I can see and script everything - I don't get that impression here.
I'll vote up the other issues, thanks for the links.
Finally, regarding my general intelli issues - the upgrade of major versions is a bit of a pain. I presume when I uninstall one version I need to leave the settings behind for the next to pick up on. But then I'm guessing that it just leaves all my old settings there unless I go and tidy up? The importing of settings - I didn't realise you could do that between jetbrains ides so that's handy. But I found with Datagrip I had to basically relearn everything as nothing was what I expected it to be.
I also found yesterday that it's really not that easy (possible?) to connect to localdb but understand the next version sorts that one out.
I think DG will be a great tool but I think it's going to take a few updates before it gets there. I didn't think 2006 was a particularly big leap but hopefully the next ones will be.
Again really appreciate you getting back to me!
John
> I changed the default behaviour because I couldn't get on with it. But I think it still does break up the scripts to run them and doesn't do so reliably. I don't really want to submit the scripts that are wrong as they are our source and I've just not had the time to try to create a simple test to demonstrate the problem. I will try, but it does happen quite often.
Sample sql file and screenshot of File | Settings | Database | General settings would help to better understand the problem. Thank you.
>What is the point of a project? What's supposed to be in it?
The project is a collection of data sources (if they were not made global data sources, i.e. stored in the IDE-wide settings), it also contains some project-specific information like Code Style, Editor colors settings.
>I think the problem with knowing when something is executed is that, say in Linqpad or SQL Management Studio the output very obviously clears and restarts. It's not as smooth looking at DG but it's obvious that something's happened because it changes for a second.
There is a progress indicator shown when the query is being executed:
Perhaps it needs to be made more noticeable for the action. Thanks for feedback, will pass it to the team.
>I'm not sure assigning colours will be that useful. How do I change connection for an existing script?
There is a widget in the status bar, where you can change the association
We also have related issue, which when implemented should improve usability problems: https://youtrack.jetbrains.com/issue/DBE-453 Please see also General Database Console Usage
>But then I'm guessing that it just leaves all my old settings there unless I go and tidy up?
If you are on Windows, you can run the installer which proposes you to delete the old settings when de-instaiilg the old version.
>I also found yesterday that it's really not that easy (possible?) to connect to localdb but understand the next version sorts that one out.
Looks like you mean the https://youtrack.jetbrains.com/issue/DBE-103 issue. There was a problem with the jdbc jTds driver version which did not well support named pipes. We've updated the interface for localdb connection and the driver, but you may also need to download dlls for authentication to work. Can be found at https://sourceforge.net/p/jtds/patches/70/
I not yet understand how the not global data sources are saved :D
For your second point I think the same.
We have "projects" which are only "attached folders"?
I make all data sources global so that they are not lost after restart.
If I reopen a "project" the "files" tab is empty and I must attach the folder again. (And the data sources if they are not global)
So I really dont know why JetBrains not did it like in PHPStorm, WebStorm, IntelliJ IDEA or somewhere else...
Thanks again for the reply. I'll have a look at those links you've posted.
Regarding changing the console - I have seen that widget before but now I'm looking for it, it's not there. I have noticed, though, that when I select it, the connection options have not enabled me to change to a different database in the project. (I think it tended to give me different numbered console options or something). Unfortunately now I can't see the widget I can't reproduce.
I've finally found the files pane which is potentially useful and has started to make the idea of a project a little more sensible. I never knew that existed before.
Another issue I've found is if I find an object like a stored proc using Ctrl+N, and then go to Save it doesn't add ".sql" to the filename. (But in other places it does.) So when I save it, it does so in a format that datagrip can't actually use it. (If it opens a suffixless script I can't connect to a data source with it at all.) Caught me out a few times.
I had an issue yesterday where I could have sworn I'd saved a script, but when I opened it, it hadn't changed at all. But then there's no "save" option I think? Can't reproduce it on demand but it's happened a couple of tmies and doesn't help with my confidence in the tool.
Also a bti odd that I can't create a database.
Btw I realise when I do an upgrade I can delete settings when uninstalling the old one, but presumably that means I can't import them in post-upgrade? It's a bit chicken and egg.
Regarding the parsing bug, if/when I manage to reproduce it with a test, then I will raise a bug on it.
#5; again, and again, and again..
I know all this project functionality came over from the IDEA which I use and love, but the way DataGrip FORCES the concept of projects and consoles on users is confusing and a huge pain in the rear. This is the single reason why I haven't been able to commit to this tool (and the terrific SQL completion and relationship insight is why I keep coming back to try it again, over and over...).
Just give me "connections" and "query tabs". Let me pick what connection I want associated with a tab and let me switch connections easily. Let me open new tabs easily with the new tab picking up the connection of the current one, but allow for easy switching.
Projects and grouping scrips together has it's place, of course, but let that be an overlay on the basic functionality, not the core concept of the entire application. Every time I fire up DataGrip after a new point release, I keep hoping for added simplicity in this area. I use it and for a few minutes and am again amazed with the ease with which I can build complex SQL... and then I try to do very simple things as mentioned above and remember why I went back to DBVisualizer.
I must echo Matthew here....
Overall, DataGrip is, like everything from JetBrains, awesome.
However, I dislike the consoles feature and would prefer a one-to-one relationship between query window and session. If you want to run two things simultaneous, you have to create a new console. And then consoles just become another thing to remember and manage; if it's 1-1, you don't have to think about it.
I especially don't like it that you can't switch your query to a different console if it has a different sql dialect from the console you're currently connected to. If you frequently switch between two servers with slightly different dialects, then this is annoying.
I understand the saving of history motivation re consoles; but there are other ways to achieve that; e.g. see the "tab history" feature in Redgate's excellent SSMS plugin SQL Prompt. This in my view is preferable especially when you deal with multiple connections to the same server, because the consoles have the effect of siloing all of the history, in that each console has its own history.
I would love it if we had the option to make it so each sql file gets its own connection / console, and if it were easy to switch connections to any server, no matter the dialect.