From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59346: Adding sqlite-backup Date: Fri, 18 Nov 2022 14:17:30 +0200 Message-ID: <83h6ywbgo5.fsf@gnu.org> References: <837czsd7sr.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14022"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59346@debbugs.gnu.org To: Andrew Hyatt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 18 13:18:16 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 1ow0Jz-0003OR-Qk for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Nov 2022 13:18:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ow0Jn-0008Sn-NK; Fri, 18 Nov 2022 07:18:03 -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 1ow0Jm-0008Sb-BB for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 07: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 1ow0Jm-00031R-2K for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 07:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ow0Jl-0005Yo-Tx for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 07:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Nov 2022 12:18:01 +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.166877385621342 (code B ref 59346); Fri, 18 Nov 2022 12:18:01 +0000 Original-Received: (at 59346) by debbugs.gnu.org; 18 Nov 2022 12:17:36 +0000 Original-Received: from localhost ([127.0.0.1]:35570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow0JL-0005YA-Qg for submit@debbugs.gnu.org; Fri, 18 Nov 2022 07:17:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow0JK-0005Xw-GW for 59346@debbugs.gnu.org; Fri, 18 Nov 2022 07:17:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow0JF-0002z0-7E; Fri, 18 Nov 2022 07:17:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=rOnc6ZQw30GE7W1y1UUe0sUHpRSsYSOSDXt4L+mSI6o=; b=Pni5DQiAbKgp rx1Tu4oZCwydvUPp04VuAWwBePeHJht/j02/YQfs3AsYcqgjH6S2vDAgUOOsb+WXUzUMxK73FwEzi ob8+QYyd3GdXpQNtp7oNXVmSCo0baeLijEpUUfyOf1OACt7gkcs8Cv2ZLelpwlk8WyEyTknD0cOII MFweoROBqbxpTP/pIX2ecYU8NGa0Vfr7foYtmEpTUefbVmmLAQ37mkgMATpADXNMzL2ZLtmsO49Rp QH1t2c/nOnb2ZDYMA5CCcQZGsmGCwlkHi3bnQI1UYTdurOUWnWMbe+4yrPkNVjmBpI0WFTLoI39TX gqAuSC82M6mC+9kEMF1fBA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow0JD-0007Ld-6s; Fri, 18 Nov 2022 07:17:28 -0500 In-Reply-To: (message from Andrew Hyatt on Fri, 18 Nov 2022 09:05:58 -0300) 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:248218 Archived-At: > 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. 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. 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. So I don't think we should extend the Emacs sqlite3 support in this direction. > But why can't we do this by invoking backup via the binary? Certainly a possibility, and in fact that's how I > would implement it if the sqlite library was instead emacsql-sqlite. However, I have no idea how to locate the > binary; that isn't part of the current built-in sqlite implementation. For good reason, too, it's a built-in > implementation, including a variable holding the executable path seems odd. I could add one, but this > solution seems better to me, since it doubles down on the built-in sqlite, and doesn't provide an alternative > mechanism for doing things with 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.