From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.devel Subject: Re: sqlite3 Date: Thu, 09 Dec 2021 09:12:41 +0200 Message-ID: <87o85q8d5i.fsf@iki.fi> References: <87tufmjyai.fsf@gnus.org> <877dcgq5ns.fsf@iki.fi> <871r2oj468.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20806"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 09 08:18:52 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 1mvDhc-0005Eq-Jm for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 08:18:52 +0100 Original-Received: from localhost ([::1]:48766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvDhZ-0002Fs-8D for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 02:18:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvDcK-0008WP-Q0 for emacs-devel@gnu.org; Thu, 09 Dec 2021 02:13:28 -0500 Original-Received: from meesny.iki.fi ([195.140.195.201]:45622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvDbx-0004Nw-Hj for emacs-devel@gnu.org; Thu, 09 Dec 2021 02:13:24 -0500 Original-Received: from mithlond (mobile-access-6df055-56.dhcp.inet.fi [109.240.85.56]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tlikonen) by meesny.iki.fi (Postfix) with ESMTPSA id 7059220167; Thu, 9 Dec 2021 09:12:48 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1639033968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FlNB2zWLMQZ3UAjOmJBKSRpPjIPRLv1t+/XxzEdIpz4=; b=oS/NrrQ8e+vi7zZ1REzJySRO97bq+stWMPP/CJTY+qNVWrAQFS8nFLVacgVY+ypfJhv37y qSmwTEvV4xKp0eh0KKUWAnrWs5t1wNktGrOROIv8JWjpPZuKagaijm/c+vIX2kALZ0zazx 7jY32f0mxmx2iMczSuVqgJKsBqihTCM= In-Reply-To: <871r2oj468.fsf@gnus.org> ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1639033968; a=rsa-sha256; cv=none; b=ieRVWrcj9J8kq8zOuIcV6+40ozyrk0o77WLWDhyREufp4MoBDh1oAaZaBhfocL26ReU7tH RYXXucwqz0Cyv7rEHiDwxHdXfJa0UmqOH7wX9cVm1ZHlav0hPz3bdfLnmyYcTCT8JQBfeb MKiTUCl5HhDIRj7qHMHvlebaB65cRsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1639033968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FlNB2zWLMQZ3UAjOmJBKSRpPjIPRLv1t+/XxzEdIpz4=; b=o96e7wf/UkiR4lG+RdTtnPJlotetiT/0XHUHWeDcRmfySP/jk1lByCcPT+unTluSVAIu7G KK2uymhu1kXZZpyxRFYjrXkMhxeqMDqZP2/Wsta+Tl5r+XpDxIizGmYUrS6S370iSBMZxu FHylzIPiRg+FcatQfGWnQLWlK1VZICg= Received-SPF: pass client-ip=195.140.195.201; envelope-from=tlikonen@iki.fi; helo=meesny.iki.fi 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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:281447 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * 2021-12-07 07:54:23+0100, Lars Ingebrigtsen wrote: > Teemu Likonen writes: > >> I think Emacs users would want automatic VACUUM so that they never need >> to worry about it. (1) One option for that is to set SQLite's >> >> PRAGMA auto_vacuum =3D FULL; >> >> before any tables are created in database. > > Thanks; that seems like an easy enough solution, so I've added it to > sticky.el. That should be enough. In this early stage of development (and without seeing the code myself) I would also suggest or remind of adding a metadata table and version number of the database structure, like this: CREATE TABLE metadata (key TEXT PRIMARY KEY NOT NULL, intvalue INTEGER, textvalue TEXT); INSERT INTO metadata (key, intvalue) VALUES ('version', 1); In my experience there will _always_ come a need to change the database structure. A version number metadata makes it easier to perform upgrades correctly. Other metadata may be needed later too. In SQL standard, PRIMARY KEY implies NOT NULL, but this is not the case in SQlite. It has to be added explicitly, thus PRIMARY KEY NOT NULL (see above). =2D-=20 /// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/ // OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQQL23klfGMkeOvdGCt57xklfWtWWwUCYbGsaRAcdGxpa29uZW5A aWtpLmZpAAoJEHnvGSV9a1ZbaasBANR2F933h9FM0xLdAO+QAKmGVMaTfw3/Rza3 kkwtcUDgAP9z4VaA3BHqEWfyClArz4bBL7+DdAY1wFzCOUfEbhmDBoiGBAEWCAAu FiEEyVtsKrXpcQtYB3W4rZ11q+6UwnMFAmGxrG8QHHRsaWtvbmVuQGlraS5maQAK CRCtnXWr7pTCc7bjAQC6S+jeehwFuvW/UjhbKbVcgKg4SNGEHu0gyy4thZCOFAEA wFBCH4B77YU9fzs4jJcw73WJ8/DUxnXwwqJBU561YQo= =yDeJ -----END PGP SIGNATURE----- --=-=-=--