timeseries / qstudio

qStudio - Free SQL Analysis Tool
https://www.timestored.com/qstudio/
Apache License 2.0
416 stars 17 forks source link

Don't let people connect to `{file}` #48

Open richb-hanover opened 4 weeks ago

richb-hanover commented 4 weeks ago

OK. I figured out how I got into such a bad state (#47). Here's my thought process that led me to the bad state.

To refresh my memory of how this looks on my Mac, I posted a video. It's at: https://youtu.be/sw9nZXIRzZo

Suggestions:

ryanhamilton commented 3 weeks ago

Hi Rich,

THanks for reporting these and the video, is really helps.. I've reworked the "File->Open" mene and toolbar option.

Now if you either:

  1. Double-Click a file in windows.
  2. Drag a drop a file onto qStudio
  3. Go File-Open

It will

  1. Check for .duckdb/parquet/db/sqlite file extension and open it as a database.
  2. Otherwise open it as a text editor.

I'm not confident of safely making your other suggested changes, The file picker or {file} check right now as given the 30+ database possibilities it's very hard to add logic in that area for 1-2 databases without breaking some of the others. I would like to first see if "File->Open" works for most users. Any remaining users that go to add server will hopefully be small in number and for very advanced cases.

ryanhamilton commented 3 weeks ago

Example: https://youtu.be/tAqVW67PWRk

richb-hanover commented 3 weeks ago

Cool! Let me know when I can play with the updated version

richb-hanover commented 3 weeks ago

Excellent! It looks as if you have implemented drag and drop in 3.05. Two observations:

Perhaps you could special case ".sqlite" and always treat it as a SQLite database, no matter where it was dragged into the qStudio window? (That interpretation would also work well if the file were dragged to the qStudio icon in the dock...) Thanks as always

richb-hanover commented 3 weeks ago

Hmmm... I dragged the .sqlite file to the top half of the "Server Tree" pane, but nothing happened. I dragged the file to the bottom half, and the database opened as expected.

I'll push my luck, and ask that a drop of a database file (such as ".sqlite") anywhere in the qStudio window be treated as a request to connect to that database file.

I will quickly admit that I have no idea how other DBMS systems handle their files, so I can't give any further guidance to you. Thanks again.

image
richb-hanover commented 3 weeks ago

As I re-read this, I also want to say that I was misled by the {file} name in the URL field. I've seen enough software tools where stuff in { ... } is magic notation, so I figured that entering the name of the file in the Name: field would do the trick. (Clicking "Add" created an empty file named {file} which led to all sorts of problems.)

To avoid that mistake, perhaps you could:

Thanks.