Re: [gnome-db] Introspection - DataModel structures



[...]
>> > it should be GDA_VALUE_TYPE_TYPE, if the docs say _STRING, it's a bug
>> > there. AFAIK, all providers use the _TYPE one.
>>
>> No, it's not a bug. The column returns the type of the corresponding
>> field
>> as understood by the DBMS, which is not the GDA type. The corresponding
>> GDA type, for a DBMS data type is given by the SCHEMA_TYPES schema.
>>
>> For example Postgres has a data type for storing IP adresses and the
>> returned data type is 'cidr' for such fields; the corresponding GDA type
>> is STRING.
>>
>> It is necessary to keep that distinction for Mergeant at least (because
>> of
>> the plugin system which is really usefull only if the DBMS type is
>> known).
>>
>> If you need to have the GDA type, then either you first get the
>> SCHEMA_TYPES schema and keep a correspondance table, or you can use
>> libmergeant which does it, or a new column could be added to the
>> SCHEMA_FIELDS schema to return the GDA type.
>>
> I guess this would be a good solution, thus avoiding the need for
> getting the types schema.
>
> Although, even easier might be to have a type_to_gda virtual method on
> the providers. What do you think?
>

Yes, and implementing both (a new column to SCHEMA_FIELDS and a new
type_to_gda virtual method) would be the best. Anyway, the providers
should keep a correspondance between the DBMS data types and the gda types
(postgres already does it), so there should not be any performance impact.

Cheers,

Vivien




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]