Carl Karsten wrote:
> Uwe Grauer wrote:
>> Carl Karsten wrote:
>>> Ed Leafe wrote:
>>>> On Jan 10, 2007, at 6:13 AM, Uwe Grauer wrote:
>>>>
>>>>> is there a special dabo-datatype for the uuid's?
>>>>> I don't think so.
>>>>    No, there isn't.
>>>>
>>>>> So how should dabo know how to display it?
>>> I'll write the code.
>>>
>>>>    Better question: *why* should we be displaying them? 
>>> Same reason there is a ^D/Debug option:  for debugging.
>>>
>>>> They are  
>>>> completely meaningless. 
>>> Not to me :)
>>>
>>>> If you want to see them for some reason, why  
>>>> not handle it in your own app?
>>> Do you think someone else may want to see them?
>>>
>>> Regardless of where the code goes, I think I need to add a 'dabo datatype' 
>>> which 
>>> I am a little unsure about.
>>>
>>> What relies on the 'dabo datatype'?  For instance, if I just add U here:
>>>
>>> # dabo/db/dbMsSQL.py
>>> def _fieldTypeNativeToDabo(self, nativeType):
>>>     """ converts the results of
>>>     select DATA_TYPE from INFORMATION_SCHEMA.COLUMNS
>>>     to a dabo datatype.
>>>     """
>>>     try:
>>>             ret = {
>>>             "BINARY": "I",
>>> ...
>>>             "UNIQUEIDENTIFIER": "U",
>>>
>>>
>>> What side effects will this have?
>>>
>>> I also found
>>> # dabo/db/dCursorMixin.py
>>>     def getFieldInfoFromDescription(self):
>>>             """ Get field information from the cursor description.
>>>             Returns a tuple of 3-tuples, where the 3-tuple's elements are:
>>>             0: the field name (string)
>>>             1: the field type ('I', 'N', 'C', 'M', 'B', 'D', 'T'), or None.
>>>
>>> If there isn't any formal documentation and or definition, now would be a 
>>> good 
>>> time to make it.  Is there something, or should I take a stab at it?
>>>
>>> Carl K
>>>
>> There are different implementations of what a GUID/UUID really is.
>> Of cause there is a MS-representation of what it should be.
>> But, as i said before, people in the database world are using different
>> representations of UUID's.
> 
> Example?
> 
>> So i do not think that we can agree about what a dabo datatype for all
>> the supported databases should look like.
> 
> If each db server has it's own flavor, it could be handled in the server 
> specific classes.   but first you have to convince me this is the case.
> 
>> I you really want to support this, try to do it in a generic way.
>> (Look at http://en.wikipedia.org/wiki/UUID).
>>
> 
> I don't see anything related to representation (how it is displayed to a 
> human) 
> on that URL: wikipedia /UUID
> 
> What do you think of this?
> 
> "Guids are most commonly written in text as a sequence of hexadecimal digits 
> as 
> such:     3F2504E0-4F89-11D3-9A0C-0305E82C3301 "
> 
> http://en.wikipedia.org/wiki/GUID
> 
> 
> Carl K
> 

Yes, the representation should be the meaningless in hex format.
But creating such an GUID/UUID is different:



uuid1(          [node[, clock_seq]])
    Generate a UUID from a host ID, sequence number, and the current
time. If node is not given, getnode() is used to obtain the hardware
address. If clock_seq is given, it is used as the sequence number;
otherwise a random 14-bit sequence number is chosen.

uuid3(  namespace, name)
    Generate a UUID based on the MD5 hash of a namespace identifier
(which is a UUID) and a name (which is a string).

uuid4(  )
    Generate a random UUID.

uuid5(  namespace, name)
    Generate a UUID based on the SHA-1 hash of a namespace identifier
(which is a UUID) and a name (which is a string).

The uuid module defines the following namespace identifiers for use with
uuid3() or uuid5().


Uwe

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to