LiveCloud Forums
Quick question re: primary keys - Printable Version

+- LiveCloud Forums (https://forums.livecloud.io)
+-- Forum: General (https://forums.livecloud.io/forumdisplay.php?fid=1)
+--- Forum: General (https://forums.livecloud.io/forumdisplay.php?fid=3)
+--- Thread: Quick question re: primary keys (/showthread.php?tid=464)



Quick question re: primary keys - stamatis - 09-06-2020

Hi all,

quick question about primary keys - in particular, creating these. 
I know the standard methods will automatically create primary keys - but is it possible to supply these yourself at record creation?

The scenario i have in mind is that you can generate a set of multidimensional arrays in LiveCode and these would link to each other with primary/foreign keys which i create in LiveCode with UUID(). So far so good.

As far as i can see however there isn't a way to supply these keys to LiveCloud to use in place of the automatically generated cdbRecordID.
Not a major showstopper but does add an unnecessary layer of complexity retrieving records as I'd have to manage a 'PrimaryKey' field on top of the cdbRecordID field...

Unless i'm missing a something major?  Very happy to be corrected Smile


RE: Quick question re: primary keys - efrain.c - 09-08-2020

Hi stamatis,

There's an example of how to do this in this thread: https://forums.livecloud.io/showthread.php?tid=462