pawelsalawa / sqlitestudio

A free, open source, multi-platform SQLite database manager.
https://sqlitestudio.pl
Other
4.58k stars 567 forks source link

Discourage opening of sqlite files in the SQL editor #4650

Open ysalmon opened 1 year ago

ysalmon commented 1 year ago

My students' understanding of files is not always adequate, and for the weaker ones, the difference between the .sqlite file that contains data and the .sql file that contains their previous work (queries) is not completely clear.

This leads some of them to open the sqlite file in the SQL editor. They quickly understand that something is wrong (but not always what and why), unless the sqlite file is big enough to throw SQLiteStudio overboard (due to trying to syntax highlight the file, I presume), in which case they cannot really act.

While I am not in favour of doing everything for them, for they have to learn, and since it is virtually never a good idea to open a .sqlite file in the SQL editor, would it be possible to get a strongly worded confirmation / alert dialog in such a case ? The dialog text may contain insults and blames about not listening what the teacher said if you want ;-).

pawelsalawa commented 1 year ago

Haha, good one :) It's not a bad idea. Especially that Ctrl+O hotkey may mislead some people to open a database, while it's a SQL Editor hotkey to load SQL script, thus it's completely valid point. Moreover, I think it may be a good idea for the application to detect such attempt and propose to add the file as a database, instead of loading it to the SQL Editor.

ysalmon commented 1 year ago

propose to add the file as a database

I think you are too kind. From a teaching perspective, this would further the state of confusion between sqlite and sql files.

I favour a suggestion/recommendation to do so, but let the user actually have to use the proper interface for adding a DB.

pawelsalawa commented 1 year ago

I'm not sure why would it push the confusion further. Maybe my intentions weren't clear. In case user would try to load a database file into SQL Editor window, the application would detect it and notify user, that he/she is trying to load a binary file into SQL Editor, which appears to be a SQLite database and he/she can proceed to the Database Dialog to add it properly as a database to the list in the application.

ysalmon commented 1 year ago

OK ; I misunderstood your intent as "have a prompt that lets user load the sqlite file as a DB instead" (ie. directly by clicking OK, without having to go to the normal Add database menu/icon).

But it appears we are on the same wavelength !

pawelsalawa commented 1 year ago

Well, what I meant was something in between - I mean after such notification, by clicking "Ok" application would open up the Add Database dialog with the file input pre-filled with the very same file, waiting for the final "Add" click from the user.

Do you thing that would be misleading?

ysalmon commented 1 year ago

From a teaching point of view, I think this is one step too much, because this allows people to use the software without ever actually using the proper menu/icon to add a DB (even if they get to the proper dialog), and thus remaining in a mental state where you just "open a file", not realising that this means nothing if you do not precise the interpretative intention of this opening.

I think people mistakingly opening a sqlite file in the SQL editor need to feel and understand that they got something wrong, and they have to start again properly. As you put it, the path they take is just one step longer, they do not have to backtrack, and imo they should.

pawelsalawa commented 1 year ago

Understood. I will just explain what's wrong and instruct the proper way to do it.

jonasseo commented 1 year ago

Understood. I will just explain what's wrong and instruct the proper way to do it.

... and then many of them will leave "dumb application, where you cannot even open file in normal way". Users want only "Next" and "OK" buttons. Your previous "... application would open up the Add Database dialog with the file input pre-filled with the very same file, waiting for the final "Add" click from the user" method is about 42 times better IMHO. ;)

pawelsalawa commented 1 year ago

One must accept that this application is not a game or video player. It's not for arbitrary people, but for database developers/devops/designers. Such people usually have at least a little understanding of what they are doing and how to use their tools. If you throw away all the pros of the tool just because of little inconvenience, it's not smart on your side.

I will try and evaluate both ways when I get to it and then decide.