From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sergey Organov Newsgroups: gmane.emacs.devel Subject: Re: sqlite3 Date: Tue, 07 Dec 2021 12:06:26 +0300 Message-ID: <87bl1s3ht9.fsf@osv.gnss.ru> References: <87tufmjyai.fsf@gnus.org> <874k7k6cga.fsf@osv.gnss.ru> <493BB435-9E63-4403-99DF-3D1409E122E4@mit.edu> 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="7590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: "larsi@gnus.org" , "emacs-devel@gnu.org" To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 07 10:08:37 2021 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 1muWSj-0001lR-N2 for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Dec 2021 10:08:37 +0100 Original-Received: from localhost ([::1]:57248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muWSi-00033D-J9 for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Dec 2021 04:08:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muWQi-0000xu-A4 for emacs-devel@gnu.org; Tue, 07 Dec 2021 04:06:33 -0500 Original-Received: from [2a00:1450:4864:20::22f] (port=46638 helo=mail-lj1-x22f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muWQg-0007eg-8s for emacs-devel@gnu.org; Tue, 07 Dec 2021 04:06:32 -0500 Original-Received: by mail-lj1-x22f.google.com with SMTP id e11so26043525ljo.13 for ; Tue, 07 Dec 2021 01:06:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=JQdN/ngCA+Xt72FjPF/RNgxIeazgSc5IgFWCXHn6kBE=; b=LzNsRvAzuAzJXAfMB+2DlbKPCNP1j/ACsUzoNz59cSyLNw2fj18KElT+sxU7pJN4nl 5rWlkRvq3v//sho3cmvC1VmepxgPHX3zcWwTht1FnnO4ktj2fENAXjloJgAgNJw4cY02 cVdLyhGzxLj41tIdHH9ugwi1TqAKGk/WF5IBaNEIXGSez5Yton5LBEhtnuAwudIV6HUj niVdcbMkD+WXQg2v3c9Voz245+pDv7CfEAW5wB162gNx9I2G+RU4YM+rxWv29AuAo7Os aQXkgWCjjf2+4oo/LE4QEkmULcyHYaVNZWlJXy6r1/+Y9Ole++KAHxkL4dXwH/zabuXd dFhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=JQdN/ngCA+Xt72FjPF/RNgxIeazgSc5IgFWCXHn6kBE=; b=jXglktPYI662EHRWt600LNxiQEm6S9l5yVHCKTO9Lx6qzqX5MyiwMeQVdoj4w0kJlb TJOAOa2UB3e4zUEEGLBRw0XtxVFX4yI5hZTW0uMIncjzVZBraQw3ciaBS29j/eIk8WxU Rn1brwBEPqgwCD23Pjztn9II3AUhiOU3Xw4jY8HuoMaJkVdpGUAlc/KoVjdUfLGRDQJ9 kLOgUU6v6Rs6ueN3esSWws8rOG0w9ZkTDZO/fXrLiEgEckWKIijqWJgZ1XG2c7fTmnCg /7kxHZCGno+Df0hrnD4LwDNyQnNt6YN9rDA4Q+u1gAuVHg7nuVzVQbRe2OQrjPHiiVZ/ plVA== X-Gm-Message-State: AOAM5300oZTlLOm4EvYLqy8bzWYVrG+6hWlEcy0s1s2h5wm82+sp4a9M UA8nrxDtb76BwrhKVO5MWQFiMdawGu8= X-Google-Smtp-Source: ABdhPJxIEsWjEoKyrlriSKJGpxdgcPAIGBe2pDiOnckAZfXGqLDF+ti4yrmj8N8w93gabq/S1dAj7Q== X-Received: by 2002:a2e:7611:: with SMTP id r17mr42734001ljc.519.1638867988119; Tue, 07 Dec 2021 01:06:28 -0800 (PST) Original-Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id bt33sm581460lfb.135.2021.12.07.01.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Dec 2021 01:06:27 -0800 (PST) In-Reply-To: <493BB435-9E63-4403-99DF-3D1409E122E4@mit.edu> (Qiantan Hong's message of "Tue, 7 Dec 2021 08:42:00 +0000") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::22f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=sorganov@gmail.com; helo=mail-lj1-x22f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:281228 Archived-At: Qiantan Hong writes: >>> I've brought this up before, but I didn't really have a solution then, >>> but I think I do now: sqlite3. >> >> Personally, I'd prefer to keep my configuration/state files in plain >> text, editable by Emacs. >> >> Would it be feasible to have common state save/restore interface for >> Emacs progrms/packages to use, and then configurable back-end to handle >> actual persistence, being sqlite3, dbm, plain (elisp) text, and what >> not? > I’ve attached a plain Elisp incremental implementation in > https://lists.gnu.org/archive/html/emacs-devel/2021-12/msg00646.html > Interface is simply > make-kv-store (path) > compact-kv-store (kv-store) > kv-put (key value kv-store) > kv-get (key kv-store) Nice! > > But honestly, I suspect using any db as backend for a persistent lisp > store will have virtually no advantage over plain text. > Then why even introduce them at the first place. That was my secret hope as well, because the obvious need for convenient universal support for persistent storage has been somehow tightly mixed with a need for some external DB, the latter being at least non-obvious. > > The more exciting thing will be to have a general object store > rather than kv-store (aka, incremental for arbitrary mutation > and preserve sharing). Any relational db will not help that either, > and it is better to be done in pure Lisp. I believe that depending on (any) DB is not the right way to go for persistent storage. It rather should be abstracted-out and then DB will likely won't be used as suitable backend anyway. Thanks, -- Sergey Organov