

If you want to create a separate file from the console, you can use the Save As… action for this. To see the details of a file, you can take a look at the tooltip on the console’s tab. If for any reason you want to create another console for a data source, this is also possible: Context menu | New | Console Located in the top right-hand corner of the query console, is a switcher where you can choose the database/schema you are working with, or, in the case of PostgreSQL, define a search path. You can write SQL here, then run it and get the result! It is as simple as that. To open it, go the context menu and click Open Console. Every data source has its own default console. Query consoleįrom our experience, the query console is the best place to write normal everyday SQL. Let’s have a closer look at these first three cases. We’ll not be talking about these in this tutorial. Object editors are internal files where you edit the DDL of each object: procedure, view, etc. In DataGrip, you can run all the files we’ve mentioned above, without opening them.Ĥ. You know where they are located and you can put them in Version Control. User files are SQL scripts you store on your machine. If the scratch file is an SQL file, then it is also an SQL editor which can be associated with any of your connections.ģ.
#Datagrip sqlite code#
We refer to scratch files as temporary notes or drafts for code ideas which are outside of the project context. Scratch files are like consoles, but they are not attached to a data source. But you can add more consoles to a data source, each of them will then create a new connection, unless that is, you use Single Connection Mode.Ģ. When you create a data source, a database console is created automatically. Query console is an SQL editor attached to a particular data source. There are four types of files where you can write SQL in DataGrip:ġ. You might already have a working directory with tons of scripts we will tell you how you can use DataGrip to deal with them too. In this post, we’ll go over whether it’s better to just use a temporary SQL editor in DataGrip or if it’s more convenient to work directly with SQL files stored on your computer.
