[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sqlite3

From: Jean Louis
Subject: Re: sqlite3
Date: Mon, 14 Feb 2022 16:31:23 +0300
User-agent: Mutt/2.2.0 (2022-02-12)

* Richard Stallman <rms@gnu.org> [2021-12-11 07:08]:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>   > Which means what exactly?  We use a tool, Diff, to compare text
>   > files.  We use another tool, sqldiff, to compare databases.  Where's
>   > the crucial difference that justifies rejecting the _capability_ of
>   > working with a DB?
> The crucial difference between text files and sqlite3 databases,
> unless I'm mistaken about the latter, is that text files are simple
> and transparent, but sqlite3 databases are not.

To see a text file on Unix-like system, one needs at least `cat'
command, or `less', `more' and similar, and better is to have text
editor. One could click on desktop system and open such file.

There must be always some program to open such file to see it
transparently, such is normally a text editor or mentioned programs.

For database it is same, one need to have a program to open it.

Files with extension *.sqlite can be opened by such programs in
console and under GUI, one example is below.

Description     : SQLite Database browser is a light GUI editor for SQLite 
databases, built on top of Qt
URL             : https://sqlitebrowser.org/

> Because text files are simple and transparent,

It is to specific case to tell what is simple and transparent. Many
text files are huge and complicated, they are transparent only to
person with the knowledge, the one who knows about it. Same is with
the databases.

> you can compare text files in many different ways: reading the two
> side by side, using diff, using wdiff, using M-x compare-windows,
> and there are probably more options.  And you can fix them manually,
> too.
> Because sqlite3 databases are neither simple nor transparent, doing
> anything with them requires using specific sqlite3 tools.

They are both simple and very transparent, in fact, it is a relational
database, and thus it is more transparent then a text file.

If I just open my ~/.emacs/init.el and take any entry out of it such

(setq bbdb-phone-style nil)

then I cannot see directly any relation to what that would mean,
unless I have profound knowledge of it. I would first have to have
knowledge of Emacs, such as to understand `setq' and that it is
followed by variable `bbdb-phone-style' and its value `nil'. Without
profound knowledge I am not able to understand what that would
possibly mean. I have to load the bbdb package and inspect the
variable with the command C-h v on it, to understand for what it
is. Thus as human being, in order to get transparency I have to work
by relations.

I would need to understand that "bbdb-phone-style is a variable
defined in ‘bbdb.el’." and that it relates to "Phone numbering plan
assumed by BBDB.  The value ’nanp refers to the North American
Numbering Plan.  The value nil refers to a free-style numbering plan."

By using key commands I have to follow relations within Emacs to
understand one line within my init.el

Compared to the database approach, one would have in the database list
of packages such as bbdb, and then variables and each variable would
belong to specific package. I would be able to click and jump to the
package and find other variables belonging to that package. And I
would not need to use Emacs to understand it, but other tools with
access to the database.

One cannot categorically say that sqlite files are not simple and not

> using database format has other advantages, and there are cases
> where they are important.  mainly when the text file is big or
> operating on it is slow.

the main advantage is the rigid structure of database types. it leads
to data accuracy, easy access to data, data integrity, feasibility for
future modification. it is definitely not only for big data. 

Main advantages of databases are various, though majority of them are
not related to size of data. 

Rather to the qualities of storage, redundancy, minimization of data
inconsistencies, easier data manipulation, and in concurrent or
network databases the concurrent access to it.

> Nonetheless I contend that, for a user who stores limited quantities
> of persistent Emacs data, the text format is better.

Size of data is not relevant when comparing text and databases.

Example with text:
I can write easily in the text file, or init.el following:

(setq baud-rate "Emacs") and it will look "simple" and

When it comes to evaluation, later in time, it will show the error,
and user in the future may not know what happened. Even though the
variable `baud-rate' cannot be set as string, the text file allows me
to write it as string.

Example with database is that such variable is already marked as
having value `integer' thus I cannot enter nothing else but integer.

It is up to database designer, thus programmers, to define properly
database tables.

> But it does imply that sqlite3 should not be the default way to store
> persistent Emacs data.

Then it could by default store `sqlite-persistent' data, marked as
such. Properties could be given to variables and functions. 

I was thinking and will still think of it to even include function
definitions into the database, not only variable values.

Some of my database backed types have their Elisp inside of the
database. The type handles itself, and not from program which is more
general and not specific. User can invent a new type and enter
specific Elisp for that type, while using the main program for data


Take action in Free Software Foundation campaigns:

In support of Richard M. Stallman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]