On 14.01.2010 16:30, Maciej Sobczak wrote:

>> In PostgreSQL backend you don't check field type
> 
> See src/backends/postgresql/statement.cpp, describe_column() function.

    This is totally unrelated to how into-type/use-type works.
> 
>> Again. What prevents adding support of unsigned short and unsigned int as 
>> first citizen in SOCI?
> 
> Again. The fact that the mapping is not 1:1 and that it is not clear 
> whether the use-case is substantial enough to warrant additional work.

    Miciej, try to stop telling me how to DO NOT do some work. I know that you 
don't want to do it. 
Try to hear me.
    I have a problem. The problem live inside a problem domain. Problem domain 
described in term of 
unsigned ints. C++ has direct representation of unsigned types. I model problem 
domain in C++ and 
want to use unsigned types to directly represent they in C++ and have full type 
check where that 
possible. I need to store data in database. Database doesn't provide direct 
unsigned types 
representation, but that can be emulated with different ways.
    One way is to map SQL INTEGER type to C++ integer AND C++ unsigned integer, 
if user want so. 
User KNOW how to work with values in she problem domain. And she required to 
choose database and 
programming language types to match each others and satisfy problem domain 
requirements.
   Please, think about this carefully.

   Try to answer to the questions:
1) Is it valuable addition for users that want to works directly with unsigned 
types?
2) What brakes for users that doesn't use unsigned types?
2) What brakes if we add such mapping in a whole?
3) Can it be implemented for existing backends?

Dynamic row will still provide x_integer type, but user will be allowed to 
directly get unsigned int 
  if she need so.
    I can just implement stupid type_conversion for this mapping and be happy. 
But why this mapping 
can't live in library directly? I,as user, don't what to write such simple 
things and remember to 
include this custom mapping when I see strange compiler error with tons of 
template instantiations.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to