How do you ATTACH another SQLite database?

Viewed 128

I have an SQLite connection set up as data source in IntelliJ IDEA Ultimate. How do you ATTACH a separate SQLite database to the connection?

2 Answers

Open Data Source properties -> Option tab -> Enable 'Single connection mode'. Close all sessions in 'Services' tool window, open new console for this data source and try something like this

attach database 'C:\temp\db1.sqlite' as db1;

it will be shown in schemas list as db1.

To persist an attached SQLite database, open the data source "Properties", click the "Options" tab, find the "Connection" section, find the "Startup script:" field, and enter the following:

ATTACH '/path/to/my/second/sqlite.db' AS db2;
Related