Cannot open zero byte file as empty database - opens as CSV file instead #2636
Description
Details for the issue
What did you do?
Opened a zero byte file as a new database with the intention of creating tables, etc.
What did you expect to see?
An empty (blank) database
What did you see instead?
Import CSV dialog. Cancelling then 'opens' in-memory database.
Useful extra information
The info below often helps, please fill it out if you're able to. :)
What operating system are you using?
- Windows: ( version: 10_ )
- Linux: ( distro: ___ )
- macOS: ( version: ___ )
- Other: ___
What is your DB4S version?
- 3.12.99 - 13 Mar 2021
- 3.12.0
- 3.11.x
- Other: ___
Did you also
- Try out the latest nightly version: https://github.com/sqlitebrowser/sqlitebrowser#nightly-builds
- Search for an existing similar issue: https://github.com/sqlitebrowser/sqlitebrowser/issues?utf8=%E2%9C%93&q=is%3Aissue%20
So I normally create a new file in Windows, give it a .db extension, then drag that into DB4S. This usually 'opens' it (sans tables, etc) allowing me to create the schema as needed.
In the newer nightly, when I drag the file into DB4S, a dialog appears, asking if I want to open this file, attach or import.
I choose 'Open'.
This dialog disappears, only for the 'Import CSV' dialog to appear.
The table name is the name of the file.
Clicking Cancel closes this dialog, but DB4S is now telling me it has an 'in memory' database open.
I assume this 'in memory' database was created and opened to import the CSV file into...
In a previous nightly I used (9 Feb) dragging a zero byte file into DB4S displayed the 'open/attach/import' dialog, but clicking on 'open' did in fact open the database.
Opening the database the 'normal' way (File, then Open) creates the same issue - the 'Import CSV' dialog is displayed.
Clicking 'File' and 'New database' works properly, but sometimes I'm in the folder where I want to be, so creating a zero byte file is easier than going back to DB4S, clicking 'File', 'New Database', then navigating to where I want the database...