sqlitestudio
sqlitestudio copied to clipboard
[20:04:42] Cannot execute query on undefined or invalid database.
Details
Here you describe your problem details, or proposal for enhancement.
Steps to reproduce
This applies only to bug reports. If this is a feature request, delete this section.
Operating system
This applies only to bug reports. If this is a feature request, delete this section.
SQLiteStudio version
This applies only to bug reports. If this is a feature request, delete this section.
Please provide more details.
I got this error when the database was disconnected and I tried to execute a query. While in my situation it was duh! I also noticed that when you "Add a database" it adds the database, but the database is disconnected! It seems like when I add a database, it should automatically connect to it. After all I wouldn't be adding it, if I didn't intend to use it. Second thing I noticed is that when you have no databases or a disconnected databases, then you cannot execute:
SELECT 2 * 2 ;
which isn't dependent upon any database. However, I do understand that in order to run any SQL you need to run it using some schema. The solution to this might be to always initialize the application with an empty memory database and connect to it when no database was given on the command line of the application, then you could do the above SQL which isn't dependent on a database without getting an error.
FYI, you can create a shortcut ...\SQLiteStudio\SQLiteStudio.exe ":memory:"
in Windows to always create an application instance with a memory database.
Somewhat related: #4064
if using sqllite make sure your connected to the database