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.bugs Subject: bug#59346: Adding sqlite-backup Date: Sat, 19 Nov 2022 08:17:21 +0300 Message-ID: References: <837czsd7sr.fsf@gnu.org> <83h6ywbgo5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10849"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Cc: Andrew Hyatt , 59346@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 19 06:18:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1owGF1-0002Zt-Fw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Nov 2022 06:18:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owGEu-0008Da-1J; Sat, 19 Nov 2022 00:18:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owGEs-0008DS-Oy for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 00:18:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owGEs-0005HB-9m for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 00:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owGEs-0003BC-5Z for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 00:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Nov 2022 05:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59346 X-GNU-PR-Package: emacs Original-Received: via spool by 59346-submit@debbugs.gnu.org id=B59346.166883505612186 (code B ref 59346); Sat, 19 Nov 2022 05:18:02 +0000 Original-Received: (at 59346) by debbugs.gnu.org; 19 Nov 2022 05:17:36 +0000 Original-Received: from localhost ([127.0.0.1]:38732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owGER-0003AU-Nv for submit@debbugs.gnu.org; Sat, 19 Nov 2022 00:17:36 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:60983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owGEP-0003AJ-Qt for 59346@debbugs.gnu.org; Sat, 19 Nov 2022 00:17:34 -0500 Original-Received: from localhost ([::ffff:197.239.5.174]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000F612E.00000000637866EC.00001098; Fri, 18 Nov 2022 22:17:31 -0700 Content-Disposition: inline In-Reply-To: <83h6ywbgo5.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248301 Archived-At: * Eli Zaretskii [2022-11-18 15:18]: > > From: Andrew Hyatt > > Date: Fri, 18 Nov 2022 09:05:58 -0300 > > Cc: 59346@debbugs.gnu.org > > > > Thanks, but I'm not sure Emacs should support DB administration > > functions of sqlite. Aren't there utilities out there which can be > > used for this? Why should we have this built-in in Emacs? why not > > simply use shell-command or somesuch to invoke the necessary external > > program? > > > > Good questions. Let me respond to your two questions: why does emacs need to be involved in backups, > > and why can't it control backups some other way? > > > > Emacs already has a file backup facility, but if emacs is primarily working with data in sqlite, there is no > > mechanism for backups, which seems scary to me. I'd like modules that rely on sqlite for data to be able to > > back up their data, because the user would like to have some security, knowing if something goes wrong > > they can always restore a recent backup. > > A database is not like a normal file, and so the fact that Emacs has > backups doesn't seem to be a reason good enough to extend the backups > to DB operations. In this case SQLite database is normal file. It is not text. But it is definitely a file. It requires usage of internal functions: SQLite Backup API: https://www.sqlite.org/backup.html > We don't bother with this when we send email or do other operations. > We also have auto-save and file-locks for normal file, but not for > DBs. And a DB is not a file, it is a (large) collection of tables > and records, and Emacs deals with at most a single table at a time, > AFAIU. You mean it is not text file. > More generally, DB administration is outside of the Emacs scope, and > how to do that properly is outside our expertise. There's more to it > than just backing up the DB. When there are sqlite functions included then so much of database administration automatically becomes available to Emacs. Statement is contradictory to the inclusion of SQLite. > This SO article: > > https://stackoverflow.com/questions/25675314/how-to-backup-sqlite-database > > (which is the first hit I get if I "how to backup sqlite database" > into the browser search box) says that you can backup the DB by using > the sqlite3 executable. I think it is reasonable to expect users who > want to backup their DB to have this executable and use it for that > purpose (and other purposes, as they need). I do have this executable > here, FWIW. > > So I think these needs should be fulfilled "by other means", not by > Emacs Lisp programs. That patch uses SQLite internals, without those, Emacs Lisp can't properly backup the database. Without that patch, Emacs which does support now SQLite would ask users to default to using external program, like: `sqlite3 currentDB.sqlite ".backup backuDB.sqlite"' but how sure are you that you will have that external program `sqlite3' in existence? When SQLite is already included in Emacs, it should not expect then that external SQLite related software is available on the system. It is logical that Emacs with SQLite included should have proper way of doing backup without relying on external tools. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/