Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Application Development » Using UUID / GUID as primary keys
Using UUID / GUID as primary keys [message #3388] Tue, 29 January 2013 19:49 Go to next message
airways is currently offline  airways
Messages: 4
Registered: January 2013
Junior Member
I would like to develop an application that uses a full GUID as the primary key for all records. How would you recommend doing this?
Re: Using UUID / GUID as primary keys [message #3389 is a reply to message #3388] Wed, 30 January 2013 02:08 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
You can if you want to, but I wouldn't, and I have no plans to build any special functionality into Radicore to support GUIDs.

Re: Using UUID / GUID as primary keys [message #3393 is a reply to message #3389] Wed, 30 January 2013 06:27 Go to previous messageGo to next message
airways is currently offline  airways
Messages: 4
Registered: January 2013
Junior Member
So Radicore only supports integer auto increment fields? Isn't that a little against your declared principals? I'm just wondering really what the best place to inject complex primary keys would be... I don't need any special functionality to do it. It's be similar to trying to keep two table's keys in sync, or any number of other very useful usages. Surely this is already possible? Radicore doesn't really seem to require keys to be in any particular format.
Re: Using UUID / GUID as primary keys [message #3394 is a reply to message #3393] Wed, 30 January 2013 06:50 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Primary fields can be whatever you like - integers or strings, single fields or multiple fields. What I am saying is that Radicore will not do anything special with GUID fields, it will treat them as strings where you supply the value.

Re: Using UUID / GUID as primary keys [message #3395 is a reply to message #3394] Wed, 30 January 2013 10:53 Go to previous messageGo to next message
airways is currently offline  airways
Messages: 4
Registered: January 2013
Junior Member
Yeah, okay, that's what I actually expected.

What I'm unclear on is the best place to initialize a new record's "complex defaults". What do you recommend as the best place to do this?
Re: Using UUID / GUID as primary keys [message #3396 is a reply to message #3395] Wed, 30 January 2013 12:47 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Take a look at the _cm_getinitialdata() method.

Re: Using UUID / GUID as primary keys [message #3397 is a reply to message #3396] Wed, 30 January 2013 13:59 Go to previous message
airways is currently offline  airways
Messages: 4
Registered: January 2013
Junior Member
Perfect! Thank you.
Previous Topic: Problem with read/update of a selected entry
Next Topic: Scheduling Application?
Goto Forum:
  


Current Time: Fri Mar 29 09:12:55 EDT 2024

Total time taken to generate the page: 0.03135 seconds