Why no persistent user settings in a database file?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Why no persistent user settings in a database file?

Tom Browder
After coming back to SQLite from a long absence, I was surprised that
setting things like .mode and .headers in a database didn't stay that way
after exiting the file.

Then I remembered something about a resource file and found .sqliterc on an
internet search and that allowed the persistent settings I wanted.

However, would it not be more natural to keep those settings persistent
inside the db file?

Thanks,

-Tom
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Why no persistent user settings in a database file?

Tom Browder
On Wed, Apr 3, 2019 at 05:52 Tom Browder <[hidden email]> wrote:

> After coming back to SQLite from a long absence, I was surprised that
> setting things like .mode and .headers in a database didn't stay that way
> after exiting the file.
>
> Then I remembered something about a resource file and found .sqliterc on
> an internet search and that allowed the persistent settings I wanted.
>

I forgot that the sqliterc IS mentioned clearly in the sqlite3 man page on
Linux systems.

-Tom
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Why no persistent user settings in a database file?

Hick Gunter
In reply to this post by Tom Browder
User preferences should not be stored in a database file, particularly settings affecting the presentation layer of the access tool (sqlite shell) that have nothing to do with the function of the storage layer.

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:[hidden email]] Im Auftrag von Tom Browder
Gesendet: Mittwoch, 03. April 2019 12:53
An: SQLite mailing list <[hidden email]>
Betreff: [EXTERNAL] [sqlite] Why no persistent user settings in a database file?

After coming back to SQLite from a long absence, I was surprised that setting things like .mode and .headers in a database didn't stay that way after exiting the file.

Then I remembered something about a resource file and found .sqliterc on an internet search and that allowed the persistent settings I wanted.

However, would it not be more natural to keep those settings persistent inside the db file?

Thanks,

-Tom
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Why no persistent user settings in a database file?

Rob Willett
In reply to this post by Tom Browder
Tom,

Because the file is the database, your preferences for how things are
displayed are just that, your preferences. Don't combine the two. If you
have two users with different preferences, who wins?

We move the SQLite database around all the time, across different
servers. We do not want the preferences for one to affect another
server.

Rob

On 3 Apr 2019, at 11:52, Tom Browder wrote:

> After coming back to SQLite from a long absence, I was surprised that
> setting things like .mode and .headers in a database didn't stay that
> way
> after exiting the file.
>
> Then I remembered something about a resource file and found .sqliterc
> on an
> internet search and that allowed the persistent settings I wanted.
>
> However, would it not be more natural to keep those settings
> persistent
> inside the db file?
>
> Thanks,
>
> -Tom
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Why no persistent user settings in a database file?

R Smith-2
In reply to this post by Tom Browder
Hi Tom,

The settings you mention, such as .headers and .mode (along with a slew
of others) are usability settings contained in the Command-Line facility
(the CLI) offered by the makers of SQLite.

It is however by far not the only such interface, nor is it in any way
related to the data in the database file.  You could use any other CLI
or GUI for sqlite which all sport their own settings - none of which
should be in the database file because it is not pertinent to other
users/uses of the DB file.

That's not to say you can't use and sqlite3 database file to house such
settings, even pass it around as an application file format  (both of
which are often the case) but it is up to the calling entity (program)
to decide the meaning of its data, the database layer itself should
never be involved with that - it should be fully agnostic to the Data
and 100% transparent.

About the CLI - It's a very useful piece of toolkit, but it's intent is
more to be absolutely correct, well tested and provide a way to test
sqlite queries etc. in a controlled environment uncontaminated by
another user-program, GUI-layer or such.

For more usability, there are a few good options in the World from CLI's
to GUI's. I see you already know SQLite studio, some of my favourites
you might try are:

- DB Browser for SQLite: https://github.com/sqlitebrowser/sqlitebrowser
Powerful and Free SQLite GUI that runs very well on Linux, MacOS,
Windows and probably wherever else you fancy seeing the inside of an
SQLite file.

- SQLitespeed: https://sqlitespeed.com/
Made for user-rich and speedy features plus a nice tool to tell you if
your schema suffers from common mistakes made in SQLite - like
double-quoted strings, wrongful Type definitions, spelling mistakes etc.
It's only Windows exe though, but I've been told it runs perfectly fine
in WINE.

- SQLiteExpert: http://www.sqliteexpert.com/
Great Windows GUI with a visual query builder (which helps a lot if you
are not an expert yet at forming SQL queries) and the personal version
is free.

Both of these Windows ones come with the DLL available on the sqlite
downloads, BUT let's you roll your own and drop-in replace the DLL to
run in your dev environment with your specific sqlite build.


There are obviously more tools out there, but between these three and
the CLI we usually get our game on. We also typically use more than one
tool for their different strengths - which is another reminder why you
do not wish to have any specific tool's settings (or heaven forbid, all
of them) in your database file.


Good luck!
Ryan


On 2019/04/03 12:52 PM, Tom Browder wrote:

> After coming back to SQLite from a long absence, I was surprised that
> setting things like .mode and .headers in a database didn't stay that way
> after exiting the file.
>
> Then I remembered something about a resource file and found .sqliterc on an
> internet search and that allowed the persistent settings I wanted.
>
> However, would it not be more natural to keep those settings persistent
> inside the db file?
>
> Thanks,
>
> -Tom
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Why no persistent user settings in a database file?

Tim Streater-3
In reply to this post by Tom Browder
On 03 Apr 2019, at 11:52, Tom Browder <[hidden email]> wrote:

> After coming back to SQLite from a long absence, I was surprised that
> setting things like .mode and .headers in a database didn't stay that way
> after exiting the file.
>
> Then I remembered something about a resource file and found .sqliterc on an
> internet search and that allowed the persistent settings I wanted.
>
> However, would it not be more natural to keep those settings persistent
> inside the db file?

These settings are nothing to do with the database file. They're settings for the sqlite3 CLI program.



--
Cheers  --  Tim
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Why no persistent user settings in a database file?

Tom Browder
In reply to this post by Tom Browder
On Wed, Apr 3, 2019 at 05:52 Tom Browder <[hidden email]> wrote:

> After coming back to SQLite from a long absence, I was surprised that
> setting things like .mode and .headers in a database didn't stay that way
> after exiting the file.
>
...

Okay, I agree with all the excellent arguments about NOT keeping user
settings in the db file.

However, why shouldn't sqliterc be documented on the SQLite website since
the sqlite3 CLI is part of the whole suite?

Simply adding the contents of the current man page would suffice for that.

-Tom
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Why no persistent user settings in a database file?

Tom Browder
In reply to this post by R Smith-2
On Wed, Apr 3, 2019 at 06:57 R Smith <[hidden email]> wrote:
> Hi Tom,
...
> About the CLI - It's a very useful piece of toolkit, but it's intent is
...
> For more usability, there are a few good options in the World from CLI's
> to GUI's. I see you already know SQLite studio, some of my favourites
> you might try are:
...

Thanks, Ryan, for a good set of references!

Best regards,

-Tom
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users