From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: sqlite3 Date: Mon, 14 Feb 2022 16:31:23 +0300 Message-ID: References: <874k7ljwkr.fsf@gnus.org> <87fsr5cuzq.fsf@ericabrahamsen.net> <878rwx8mdn.fsf@gnu.org> <87r1aphuei.fsf@gnus.org> <837dcex6ub.fsf@gnu.org> <83a6h9tu1c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40553"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.0 (2022-02-12) Cc: eric@ericabrahamsen.net, cesar.mena@gmail.com, emacs-devel@gnu.org, pipcet@gmail.com, Eli Zaretskii , larsi@gnus.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 14 15:07:05 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJc0O-000AHI-V8 for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Feb 2022 15:07:05 +0100 Original-Received: from localhost ([::1]:40688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJc0N-0003LD-OL for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Feb 2022 09:07:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJbVI-000324-7s for emacs-devel@gnu.org; Mon, 14 Feb 2022 08:34:56 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:37709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJbVC-0005Ta-5v; Mon, 14 Feb 2022 08:34:53 -0500 Original-Received: from localhost ([::ffff:41.75.189.127]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000055D52.00000000620A5A6B.00007518; Mon, 14 Feb 2022 06:34:35 -0700 Mail-Followup-To: Richard Stallman , Eli Zaretskii , eric@ericabrahamsen.net, larsi@gnus.org, cesar.mena@gmail.com, pipcet@gmail.com, emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286266 Archived-At: * Richard Stallman [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 as: (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 transparent. > 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 transparent. 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 management. Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/