Hello,

Konstantin Litvinenko wrote:

>    You already implement int and short. What is the difference in unsigned 
> int and signed int? It is 
> semantical and there is no difference in data representation. SQL doesn't 
> have unsigned 
> representation, but all signed maps to unsigned directly without any data 
> loss. So, why we cannot 
> map C++ unsigned int to SQL INTEGER and C++ unsigned short to SQL SHORT?

Because this is not how the mapping is done. For example, for PostgreSQL 
there are native types that are used for mapping instead of SQL types.
There is also a mapping in the other direction - for example, if the 
database returns something that has type SQL INTEGER, which of the C++ 
types should that map to? int or unsigned int? If the mapping is not 
reversible, the code would have to be more complex to handle different 
cases.

Please review one or two selected backends code and try to see whether 
your idea would fit there.

Regards,

-- 
Maciej Sobczak * www.msobczak.com * www.inspirel.com

------------------------------------------------------------------------------
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