Are row and column ids unique within a table, doc or all of Coda?

I am building a Python wrapper for the coda API for my personal use. I am thinking of using memoization to avoid inadvertently making two different instances of a class that reference the same underlying Coda object.
Within what scope are any given Row or Column Id (e.g. “i-xO7AkdeVUf”, “c-oFoN-MxS7F”) guaranteed to be unique? For example if they are only unique within the table, then I would also need to include the Table ID and the Doc ID in my hash to ensure no collusion.

Short answer: not unique :slight_smile:

Long answer: all of the IDs (table, view, column, row, page, line etc) are generated through a regular random upon creation of an object. 10 characters are sufficient to call it a good random. The IDs are created on the client side so potentially there is a little risk of collision but it’s negligible IMO.

However, when you copy a doc, all object IDs are cloned as well into the new doc, not regenerated.
And when you duplicate a table within a doc, all column IDs and row IDs are copied too.

So yes, you have to include Doc ID and Table ID within hashes for your row and column keys.

7 Likes

Thanks @Paul_Danyliuk, clear and thorough answer.
While I have you I also wanted to say thanks for all your content. I learned so much from your posts over the past couple of years and have critical docs with 10+ users that fully depend on your Mega-tricks.
Oh and, Go Ukraine :ukraine::muscle:!

4 Likes