DataGrip Overview, Part 10: SQL Files and DDL Data Sources
In a Nutshell
DataGrip's File Tools window lets you attach local folders and run SQL files with proper dialect/context so code completion and execution work. You can run multiple dump files via run configurations to recreate schemas and load data, and DataGrip surfaces errors for review. DDL Data Sources turn collections of SQL files into a browsable schema you can diff against real databases to manage schema changes through version control.
These notes were generated by AI and may contain inaccuracies.
The File Tools window is one of the most important tool windows in DataGrip. Opening it with the shortcut "command" and "two" makes it appear on the right side of the screen. The File Tools window displays work files from any folder on the local computer. To open a folder, or attach a folder to this window, use the button and select the needed folder.
For example, attaching a folder named "my scripts" makes its contents visible in the Files window. Opening the "queries.sql" file, which contains a simple "select" statement, triggers a notification that no SQL language is initialized for this file.
The dialect is set to PostgreSQL SQL, followed by specifying the context, data source, and schema. From that moment, the file understands the context. Writing code in this file enables code completion and all other software helper features to work. Running this query produces results.
Making changes to the file, such as adding a new query, causes a green bar to appear in the margin (the panel to the left of the text editor). This indicates differences between this version and the version in the version control system. Clicking on the green bar opens the Differences Viewer, which shows the changes.
Uploading (committing) changes is done through the Git interface in DataGrip. Both commit and commit-and-push operations are available for changes.
Sign in to read the full notes
Get access to AI-generated notes, topic timestamps, and more.




