From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Georges Ko Newsgroups: gmane.emacs.devel Subject: Re: sqlite3 Date: Thu, 09 Dec 2021 23:52:11 +0800 Organization: gko.net Message-ID: <86y24t7p3o.fsf@gko.net> References: <87tufmjyai.fsf@gnus.org> <2F63580E-FF58-45D0-9DBB-389ED64C0F11@mit.edu> <2176540.5f6G0mJ9Du@galex-713.eu> 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="31679"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Hamster/2.0.0.1 To: emacs-devel@gnu.org Cancel-Lock: sha1:HXZAvf+y23xnYpyyQezx8r//TCw= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 09 16:53:07 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 1mvLjH-00085w-F3 for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 16:53:07 +0100 Original-Received: from localhost ([::1]:57726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvLjF-0003Gk-HR for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 10:53:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvLif-0002b9-Dm for emacs-devel@gnu.org; Thu, 09 Dec 2021 10:52:29 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:37488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvLid-0004Vi-SG for emacs-devel@gnu.org; Thu, 09 Dec 2021 10:52:29 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mvLib-0007E9-JE for emacs-devel@gnu.org; Thu, 09 Dec 2021 16:52:25 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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:281512 Archived-At: Alexandre Garreau writes: > Le merkredo, 8-a de decembro 2021, 6-a horo kaj 41:17 CET Qiantan Hong a > écrit : >> 3. Database files are not readable directly by a text editor. > > Well, if we start supporting sqlite, emacs might become such an editor! > Imagine if when you opened a binary sqlite3 database emacs offered you the > database, with many elisp commands to edit it by hand? think like > phpmyadmin, but lighter I guess the first thing that would be written is a sqlite3 "REPL" client... Then, sqlite3 database files would be processed in the same way as tar files: - press 'f' in dired on a .db file: - the list of tables, indexes, etc. are shown - press some key to manage tables, indexes, ... - press some key to create, delete, ... tables, indexes ... - press some key on some table name to show table description: - press some key to enter edit mode to add, remove or edit columns, etc... - press some other key on some table name to display the content of the table in something similar to an org-mode table: - press some key to enter edit mode: - delete a line = delete that row - insert a line = insert that row - edit some fields = update these fields - etc. - once finish, press some key to commit... That's for one file. If another file is opened, then the whole 'dired' playbook can be applied: - with two table lists buffers: - press some key to copy the table in the other file (think dired-dwim-target), - press some key to create the table schema in the other file, - etc... - with table1 content of file A and table2 content of file B shown, assuming they have the same columns: - mark table1's rows, then press some key to copy to table2, as you would with file... - or press some key and you can happily edit/copy/paste between the two buffers - etc... That would work through TRAMP as well... > We could see new usages of emacs, replacing more other programs with the > emacs way, or replacing *better* programs emacs (that is, Lars, through > emacs) is already trying to replace, such as MUA (gnus, rmail), and > browsers (eww). Let's say there are other backends (maybe something similar to Clojure CIDER/nrepl with JDBC clients connecting to databases and communicating back to Elisp) which are compatible with the stuff above: you end up having a universal database viewer/editor (limited by performance of Elisp), where you have an unified way to view and edit databases, where you could copy rows between two totally different databases by just copying/pasting lines, with Emacs doing the mediation between the clients... Georges -- Georges Ko gko@gko.net 2021-12-09