expert
expert

Reputation: 30125

Where does IntelliJ IDEA store database console scripts?

I couldn't find answer to this questions on SO despite long search. For some reason I thought I've seen it before.

Do you guys know in which file IDEA saves content of database console scripts ?

I thought it was in dataSources.ids but I don't see scripts there, only connection settings.

Upvotes: 9

Views: 4958

Answers (6)

Draken
Draken

Reputation: 3189

Newer versions of IntelliJ on Windows, you can find the folder in the Roaming directory:

C:\Users\$user\AppData\Roaming\JetBrains\IntelliJIdea2024.1\consoles\db\$uniqueId\

Depending on the IntelliJ version, you will need to change the IntelliJIdea2024.1 folder to the appropriate one.

Upvotes: 3

Nexonus
Nexonus

Reputation: 815

On newer version of IntelliJ (2020+) for Mac it can be found here:

~/Library/Application Support/JetBrains/IntelliJIdeaYOUR_VERSION/consoles/db

Update (2024-04-25): Still works in IntelliJ 2024.1

Upvotes: 6

sjoroos
sjoroos

Reputation: 11

Adding Ubuntu default to the list of answers, ofc you change IntelliJIdea2020.1 with your version.

~/.config/JetBrains/IntelliJIdea2020.1/consoles

Upvotes: 1

slorinc
slorinc

Reputation: 2506

Mac versions store it at :

~/Library/Preferences/IDEA version/consoles/db/

Upvotes: 1

Nilesh Kapadia
Nilesh Kapadia

Reputation: 71

If you are on Mac OS X, and as of IntelliJ IDEA 14, this gets stored here:

~/Library/Caches/IntelliJIdea14/userHistory/*.xml

I suspect that OS X updates sometimes clear ~/Library/Caches, because after the OS X 10.10.2 update I lost my database console history. If the contents of your database console are important to you, make sure you are backing up this folder and not excluding it in your Time Machine backup!

Update (2016/09/23): At some point they moved it out of Caches and into the preferences folder, which is good because you no longer have to worry about macOS updates wiping it out. For example, it is here in the current version:

~/Library/Preferences/IntelliJIdea2016.2/consoles/db/

Upvotes: 3

Ashutosh Jindal
Ashutosh Jindal

Reputation: 18869

Try looking into the IntelliJ cache folder.

For me I did not find the database scripts themselves, but found a history of all the sql statements executed here :

`c:\Users\$user\.IntelliJIdea13\system\userHistory\*.xml`

(Am on IntelliJ Idea EAP).

Upvotes: 6

Related Questions