Re: uuid field [was: more than one BBDB file]

2016-10-25 Thread Sriram Karra
On Mon, Oct 24, 2016 at 4:34 AM, Roland Winkler  wrote:

 This relates to one item that has been on my BBDB todo list
> for a long time: add uuid fields to each record so that BBDB can
> check more reliably whether two records are "equal".  Here uuid
> fields will come handy in a range of use cases, with multiple
> database files, but also, say when importing and exporting BBDB
> records from / to other databases.
>

ASynK does exactly that - add an xfield called 'bbdb-id' that holds a uuid.

So the uuid field should become a "compulsory" field (appearing in
> the "backbone" of each record).  This requires to change (once more)
> the internal format of BBDB records.  Then I was wondering: Are
> there other (unrelated) changes in BBDB's internal format of storing
> records that would be desirable?  Here I thought of the two xfields
> creation-date and timestamp.  For a long time, they have been
> implemented as xfields.  Yet it would be cleaner if they likewise
> became elements of the "backbone" of each BBDB records.
>

These two timestamp fields, along with uuid, are all required for making
sync work at all. As such I agree with your thinking here with regards to
these fields.

Note that the two timestamp fields were not present before BBDB v3. So the
extend of potential breakage in backwards compatibility is not that sever.


>
> Did anybody already try to implement / use a uuid field as xfield?
> I guess that when BBDB will upgrade itself to the new record format
> using "backbone" uuid fields, it should check whether the records
> already have such an xfield.
>

I did exactly that and even raised some patches to bbdb v3 back when Barak
Pearlmutter was more active on this list. I cannot remember the details any
more what happened to the patches I sent him, which can still be found on
this branch (search for my userid: skarra) :
https://github.com/barak/bbdb3/commits/uuid?after=wEoFQcQQ%2BvEkHMAiFsoVaKZRororMTc0
You are free to use code from there, of course.

Note that ASynK just adds uuids when one is not found in the xfields. It
would just make it a more consistent experience if there was a standard way
to do this, that's all.

-Karra
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Re: uuid field [was: more than one BBDB file]

2016-10-25 Thread Saša Janiška
"Roland Winkler"  writes:

> Currently BBDB supports only one such file.  I'd like to extend
> that.  This relates to one item that has been on my BBDB todo list
> for a long time: add uuid fields to each record so that BBDB can
> check more reliably whether two records are "equal".  Here uuid
> fields will come handy in a range of use cases, with multiple
> database files, but also, say when importing and exporting BBDB
> records from / to other databases.

That would be great to have, indeed. Single BBDB file is also the
reason why I won’t go into ASynK route and stay with bbdb-vcard
mechanism.

> Here are a few thoughts about uuid fields, please comment:

I’m too new with BBDB to be able to comment not being familiar with BBDB
structure…

> So the uuid field should become a "compulsory" field (appearing in
> the "backbone" of each record).  This requires to change (once more)
> the internal format of BBDB records.

That’s clear.

> Then I was wondering: Are there other (unrelated) changes in BBDB's
> internal format of storing records that would be desirable?  Here I
> thought of the two xfields creation-date and timestamp.

No idea about that one.


Sincerely,
Gour

-- 
One must deliver himself with the help of his mind, and not
degrade himself. The mind is the friend of the conditioned soul,
and his enemy as well.


--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/