On Mon, 10 Feb 2014 10:23:57 -0500 Richard Hipp <d...@sqlite.org> wrote:
> Proposed Change To Address The Problem: Thank you for addressing this. I for one think you're getting a lot of unhelpful advice. A database application that loses data? As a feature? > (1) Detect double-click launch by looking at argc and argv. Why make this a special case? If no database name is provided, the behavior should be the same regardless of how launched or what OS. Easier to explain; easier to understand. > (3) Announce the name of the "standard" database file in the banner. Unnecessary IMO, see next. > (5) In what folder should the "standard" database file be created? The folder, er, directory should be the user's home directory, located by exactly the same logic that locates ~/.sqliterc. > (4) What should the name of the "standard" database file be? ${HOME}/.sqlite/db would be my choice. Let's consider the ramifications of these choices. Every time sqlite3 is launched without an explicit database name, ${HOME}/.sqlite/db is opened. The naïve user never loses so much as a row; whenever the application is opened, yesterday's data are still there, safe and sound. In keeping with the principle of "data independence", the location is unimportant. SQLite Just Works. The inquisitive user could RTFM. Or, say, type ".help", followed by ".databases". The distance from the command prompt to the required information is both short and consistent with other uses of sqlite3. The default location is the most likely place on the disk to which the user has write permissions. By choosing a dotfile, the name is normally hidden, yet easily discovered. It doesn't interfere with current use or pester the user with still more text and prompts. I would prefer to see sqlite3 move in the direction of quietude. Already 6 lines stand between command and prompt: $ sqlite3 | nl -- Loading resources from /home/jklowden/.sqliterc 1 SQLite version 3.7.13 2012-06-11 02:05:22 2 Enter ".help" for instructions 3 Enter SQL statements terminated with a ";" 4 sqlite> Other thoughts: 1. To retain existing behavior, consider making attach database :memory: as main; valid SQL in ~/.sqliterc. As an interesting bonus, support for detach main would remove "main" as a special case. 2. Consider a -mem option for those situations when ${HOME} is 0400 or the user knows he want to discard the database on exit. Humbly submitted. --jkl _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users