Hi Danielo,

I faced the same problem with tiddlymap. When just renaming a tiddler,
you have no information about what was the original title and what were
the original fields. This makes it hard for any external db or even a
plugin (like tiddlymap) to track which original object changed.
Therefore, I created an issue a few months ago that should append the
previous tiddler object to the changed tiddlers list during refresh so
we know the name and fields of the original tiddler.

https://github.com/Jermolene/TiddlyWiki5/issues/1550

> Sticking to the name as an unique identifier we will lose track of
> tiddler in every database system once you rename it.

Your problem of "losing related attachments" is not nice but you have NO
CHANCE to fix that as it is the tiddlywiki design and the same as
link-breaking when changing the title. I think the only reason
tiddlywiki preferred titles as primary key over ids is because in
contrast to a db the user is directly involved and linking titles is
easier to handle than linking ids or adding a layer that abstracts the
id. This decision is highly understandable because it simplifies
interaction and allows quick indexing by name but it comes with many
disadvantages as you described them already, especially that renaming a
tiddler will make you lose track. But as said, maybe
https://github.com/Jermolene/TiddlyWiki5/issues/1550 could be a solution
here.

For tiddlymap I partly solved it like this: I give all tiddlers used in
the maps a unique id which helps me to trace name changes (because the
id stays the same) and therefore I can still display relations even when
you changed the name! When I detect dublicate ids (e.g. after cloning) I
automatically fix them (and display a dialog) right when they occur.

I would love to see Tiddlywiki assign a unique (=repeatedly choose
highly random value until unique) id to every tiddler it creates which
cannot be changed by the user and is hidden (like the e.g. the
"draft.of" field we cannot see or the "created" field that cannot be
modified). So we can use it for db operations or other. Tiddlywiki
itself does not need to use this id at all but it is nice for us to have it.

> Or should be treat the tiddler just as a collection of fields that we
> store in a particular entry of our DB

Then you could as well use the title

Hope it helps
Felix

On 26.05.2015 10:59, Danielo Rodríguez wrote:
> Hello everyone,
>
> I know that the topic of titles as tiddlers ID have been discussed
> several times for TW itself. But what about external stores? This is
> directly related to sync adaptors and external databases as store for
> the tiddlers.
> Normally in databases there is a primary key, that is unique and
> incremental, and then the user data/fields. This have several
> advantages like traceability of a single element among all their
> changes. Sticking to the name as an unique identifier we will lose
> track of tiddler in every database system once you rename it. This is
> because how TW handles tiddlers: every change on a tiddler means
> deleting the old version and substitute it with a totally new one.
> This is against any DB system I know, and recently I have faced
> several problems (like loosing related attachments) because of that.
>
> That's why I'm asking community for the best approach. Should we stick
> to titles as IDs when we sync to a remote database? Or should be treat
> the tiddler just as a collection of fields that we store in a
> particular entry of our DB? Of course the syncadaptor should handle
> the conversion however it's needed.
>
> Thanks for your point of view.
> -- 
> You received this message because you are subscribed to the Google
> Groups "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/e53f5ef2-225a-4f88-8483-3d094300a259%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/e53f5ef2-225a-4f88-8483-3d094300a259%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/BLU436-SMTP271F605A62638A9B43613DCECC0%40phx.gbl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to