emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sqlite3


From: Georges Ko
Subject: Re: sqlite3
Date: Thu, 09 Dec 2021 23:52:11 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Hamster/2.0.0.1

Alexandre Garreau <galex-713@galex-713.eu> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]