help-recutils
[Top][All Lists]
Advanced

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

Re: [help-recutils] recsel --join with multiple fields


From: Jose E. Marchesi
Subject: Re: [help-recutils] recsel --join with multiple fields
Date: Tue, 10 Jul 2018 21:41:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

    > Hi Héctor.
    >     
    >     Is it possible to include multiple fields in the recsel --join option
    >     ? If not, that's fine, I guess I will figure it out how to solve my
    >     recsel needs with this limitation. I can't remember if join by
    >     multiple fields/columns is a common practice in SQL and I didn't find
    >     any example of that kind in recutils documentation.
    >     
    >     Thank you in advance for any info or orientation.
    >     
    > --join accepts only one field, which should be defined as a foreign key
    > in the referring record descriptor.  Something like:
    > 
    > %type: Abode rec Residence
    > 
    > This will make Abode a foreign key referring Residence's primary key.
    > Since primary keys are limited to single fields in recutils, it follows
    > that foreign keys should also be restricted to a single field and
    > therefore joins are likewise limited.
    > 
    > What are you intending to do anyway?
    
    Thank you for your reply!
    
    I can't remember the specific query that I was trying to solve back in
    May when I posted this question for the first time, but I have managed
    to solve my query needs so far by using single fields in my recutils
    primary keys, as you said.
    
    What I've been doing for the last couple of months is to put together
    a database for my small online school's CRM. Since it's a small
    business and most of my admin tasks are run via ssh using CLI apps, I
    thought it could make sense to use recutils with well structured
    recfiles and bash scripts, and wait until the volume and complexity of
    the database activities will demand to migrate to MySQL. I estimate
    that I will be handling the records of hundreds students (actually
    leads + active students, since it's a CRM) for the first 6 to 10
    months. The busiest scenario I can picture is 2000 people in my
    database in 12 months.
    
    Do you think it makes sense to start my small CRM using recutils, and
    then migrate somehow to MySQL when volume and complexity will demand
    it? Or should I keep recutils for my personal databases (Org-mode
    stuff, for example), not even trying a CRM but rather using MySQL from
    the beginning for such a project?
    
I would say yours is a good plan, but only if you can express the data
integrity required by your database without having to resort to many
(any?) external hacks.  As you have seen, recutils implements a sort of
relational model that has its limitations, like not supporting
multiple-field keys.

My personal usage of recutils (which is basically the main reason why I
wrote them) usually consists in editing the recfiles manually (Emacs),
handling the validation of the integrity of the data and encryption with
the utilities.  For most of my queries I use recsel directly, without
any kind of wrapper.

Said that, the combination of the utilities and the bash built-ins
should provide a decent framework to handle the data automatically
so... up to you! :)




reply via email to

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