From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vikas Rawal Subject: Re: Exploring properties Date: Tue, 25 Feb 2020 08:28:47 +0530 Message-ID: <20200225025847.hy7k7a3zqvh5wjgm@rewasi> References: <87sgj163y9.fsf@gnu.org> <20200223132152.5tbrayjzpce4ri3k@rewasi> <87a7592zi0.fsf@gnu.org> <87pne4z8dk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44584) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6QS6-0005tK-NQ for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 22:00:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6QS5-0007WU-CE for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 22:00:06 -0500 Content-Disposition: inline In-Reply-To: <87pne4z8dk.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Bastien Cc: org-mode mailing list , "Jose E. Marchesi" I don't know if this is useful. But this is what I could come up with. This might at least motivate somebody to think of other possible advantages/uses of building org-mode capabilities to interact with databases. Vikas --- Feature request: To build tools to facilitate using org-mode as a front-end for interacting with a database. The idea would be to use org-mode to select, insert and update records in a database. It is natural to think of recutils, a plain text database, as the database backend. But a more generalised solution may allow other choices of databases. With a text-based database backend like recutils, we could harness a version control system like git to semi-automate collaboraion. Why would one use org-mode for creating a database application? One can think of many advantages. But the biggest advantage (to me) would be that, in this setup, a multi-user database application can work without constant internet connectivity. You can query recutils files, insert/update records, and then let git deal with synchronisation across the team members. There are other advantages as well. We do not yet have a text-based, easy-to-deploy database application system. Recutils provides the infrastructure for a backend. But we do not have a fully-developed front-end system to interact with recutils. Org-mode is clearly best placed to provide the frontend for working with recutils. Needless to say, this would be particularly interesting to members of the org-mode/emacs fan-club. Over the last few years, org-mode has come to be used for many tasks that go way beyond what Carsten had in mind when he first built org-mode. From web-publishing to writing books, org-mode provides excellent tools. Being able to create and use databases from within org-mode would be a very useful addition to this toolkit. We already have tools that can be used to read data from recutils (and other databases) and create reports in org-mode. The missing feature is to be able to use org-mode to create/update records systemmatically. There are two possibilities here: to use org-mode tables or org-mode properties to interact with the database. The advantage of doing this using the org-mode properties is that the column-view of properties provides an easy to use interface for entering data. There is already a mechanism for defining "Allowed" values for any field which speeds up data entry and helps avoid typing errors. There are several challenges. Some of these are: 1. Extending "Allowed" values to specify type of data that can be recorded (numeric, char) or range of values. 2. How to deal with relationships/foreign keys. Can property inheritance be used to deal with at least simple foreign key constraints? 3. Org-mode macros provide {{{property(PROPERTYNAME)}}} syntax for macro replacement during export. But nothing as simple as this is available for use in source code blocks. Something like this would allow using some code to add/update records in a database. We should perhaps build on the property API or org-ql for creating something like this. If we can resolve some of these and creating a simple application for demonstration, it might help in showing the potential and identifying other challenges. On Mon, Feb 24, 2020 at 09:39:51AM +0100, Bastien wrote: > Hi Vikas, > > Vikas Rawal writes: > > > I am essentially thinking of org-mode providing an > > interface for feeding data to recutils. > > Yes, that would probably be useful. > > If you want to write a feature request, please write it as if the > reader does not know recutils and you precise use-case, so that we > understand all implication and motivate possible contributors. > > Thanks, > > -- > Bastien >