From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrew Hyatt Newsgroups: gmane.emacs.bugs Subject: bug#59346: Adding sqlite-backup Date: Thu, 17 Nov 2022 23:40:11 -0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000099912d05edb5a0cc" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16295"; mail-complaints-to="usenet@ciao.gmane.io" To: 59346@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 18 03:41:33 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 1ovrJs-000451-Fq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Nov 2022 03:41:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovrJQ-0001nu-KL; Thu, 17 Nov 2022 21:41: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 1ovrJP-0001nS-7o for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 21:41:03 -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 1ovrJO-0005ZY-QN for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 21:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovrJO-0004Uy-4C for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 21:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Nov 2022 02:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59346 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Bug-Gnu-Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.166873924617256 (code B ref -1); Fri, 18 Nov 2022 02:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Nov 2022 02:40:46 +0000 Original-Received: from localhost ([127.0.0.1]:34806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovrJ8-0004UF-46 for submit@debbugs.gnu.org; Thu, 17 Nov 2022 21:40:46 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:50036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovrJ3-0004U4-O5 for submit@debbugs.gnu.org; Thu, 17 Nov 2022 21:40:44 -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 1ovrJ2-0001gh-DY for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 21:40:41 -0500 Original-Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovrIr-0005Qc-Ss for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 21:40:40 -0500 Original-Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-368edbc2c18so37050007b3.13 for ; Thu, 17 Nov 2022 18:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=rFq/ytiBRchSA6hbd4g9NQ4QNuO4MNlaWHROvQjNgB8=; b=BXicQp24k8aP/r1krABTQzIP6TlbzPA9Si8OPKbKL5HPLNyQoSnGZs2L2EesMIURD/ tKLF8MswfE4VSbaZ+qZASvdQh9n+mOr3z33X6txILXEGtcyKLIi1j6IeaBq8VNUS0oaY 1CHLMvgYlnFWUjC+i+NfViCX3UkOMwqRbqglNhVCS6wTfy1RP5+sZGs34FI0gsuA2qUy mHQKoJPdaPyNwB2VYhMh6ICiemyb/CRuGz0+w4D0VqzIgkimc01Z70Z2PpxqSe0wmo5q GrvmOlPDwdboQ4y/80LR4kvdo3Esj9eNNGig+I88qk1Mih7/quAic01q5ceGIjb6LATW 2oHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rFq/ytiBRchSA6hbd4g9NQ4QNuO4MNlaWHROvQjNgB8=; b=fzva5c/xkZvCQCI3SRrLri64/UPQiU7JL4xi2PomAKTCNCIhxclVyt+HDfvH8FvLpH tUjglbTcPxaiYum/rL8KZkwYxMq1yTFGeZCGBSt1iekxaBOf119nEdKquFnrZ7nbkLXS BBApNmfmTv6GeYhfOPjo0Cl1WknIZOPAlAAS08Kk9WgMCRAM0wXS9JCswLOM4b2Zw/jN M8TmPZBIsw65woNPIg40ci3h/qhH3KrXc4hb42FNe/Bc57/RLz4t6uI9FWLTB3Sm4Ef8 WLzS0i+66MyxYzgsUkVNi9WBBetcwypWsXhoBtBZBsQjpjG9nf6BbIznVM5+G3Ne1o0S es8A== X-Gm-Message-State: ANoB5pmtJ8HUOm5dwBgI8oWeyltAg9l8bSeZYmPEm2C/Sy6MyBfJlzcY 80niTrEz61qBZncIlpMxjWfYbap2ao1Kw6OSCD5K59L4qi4= X-Google-Smtp-Source: AA0mqf7nUtS0lCP5Ye74pFEYTkOUkxP1gLpxToDFL520hW50gQFDyTs85bbnla3kPjm3X0SyQAe73kadbo6aI0oyF2w= X-Received: by 2002:a05:690c:789:b0:373:5455:6125 with SMTP id bw9-20020a05690c078900b0037354556125mr4746849ywb.27.1668739222789; Thu, 17 Nov 2022 18:40:22 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::112a; envelope-from=ahyatt@gmail.com; helo=mail-yw1-x112a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:248158 Archived-At: --00000000000099912d05edb5a0cc Content-Type: multipart/alternative; boundary="00000000000099912a05edb5a0ca" --00000000000099912a05edb5a0ca Content-Type: text/plain; charset="UTF-8" Currently there's no great way to perform a proper backup of a sqlite database if you use the built-in sqlite in emacs 29. If you just copy the file, there's a chance another database user is in the middle of something, and the database could be corrupted. I've included a patch that fixes this. I would the sqlite-backup function to exist so I can use it in the ELPA triples package. --00000000000099912a05edb5a0ca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Currently there's no great way to perform a proper bac= kup of a sqlite database if you use the built-in sqlite in emacs 29.=C2=A0 = If you just copy the file, there's a chance another database user is in= the middle of something, and the database could be corrupted.

I've included a patch that=C2=A0fixes this. I would the sqlite-b= ackup function to exist so I can=C2=A0use it in the ELPA triples package.

--00000000000099912a05edb5a0ca-- --00000000000099912d05edb5a0cc Content-Type: application/octet-stream; name="0001-Add-sqlite-backup-a-function-to-backup-sqlite-databa.patch" Content-Disposition: attachment; filename="0001-Add-sqlite-backup-a-function-to-backup-sqlite-databa.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lalw5nun0 RnJvbSAyZDgyODllMzRlZTc3MGEwOGM0ZjI2OTY5YWE1ZmI3YTM4Njg5OGQ5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbmRyZXcgSHlhdHQgPGFoeWF0dEBnbWFpbC5jb20+CkRhdGU6 IFRodSwgMTcgTm92IDIwMjIgMjM6MzE6NTMgLTAzMDAKU3ViamVjdDogW1BBVENIXSBBZGQgYHNx bGl0ZS1iYWNrdXAnLCBhIGZ1bmN0aW9uIHRvIGJhY2t1cCBzcWxpdGUgZGF0YWJhc2UKIGZpbGVz CgogICAgKiBzcmMvc3FsaXRlLmM6IGNyZWF0ZSBuZXcgZGVmdW4gc3FsaXRlLWJhY2t1cCwgYW5k IGFkZCB0aGUKICAgIG5lY2Vzc2FyeSBmdW5jdGlvbiBpbXBvcnRzIGZyb20gc3FsaXRlLgotLS0K IHNyYy9zcWxpdGUuYyB8IDU3ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysKIDEgZmlsZSBjaGFuZ2VkLCA1NyBpbnNlcnRpb25zKCspCgpkaWZmIC0t Z2l0IGEvc3JjL3NxbGl0ZS5jIGIvc3JjL3NxbGl0ZS5jCmluZGV4IDA4YmY2OTZiOGMuLjc3MTRl MDUyOWEgMTAwNjQ0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