Hi,

Apparently, I have lost track of some decisions about how we want to support
integer types in SOCI. I've been reviewing old and very old unread posts
hiding in my inbox and I've got confused.

Here are my findings:

1) Here is old thread "unsigned int and SOCI" from 2010 in which Maciej
explains reasoning behind certain decisions regarding lack of unsigned int
mapping:

http://sourceforge.net/mailarchive/message.php?msg_id=24344961

2) I found some forgotten work made by Julian Taylor:

http://sourceforge.net/mailarchive/message.php?msg_id=26994744

Julian created inttypes branch in which he implemented integer support
based on the C99-based types available already in C++.
Here is one of the major commits in the branch:

https://github.com/juliantaylor/soci/commit/4d9555a50477e38346f5248b6877c5e5e95f7bbe

3) Latest changes related to integer types support were made by Vadim,
here are two important commits:

a) Handle unsigned integer types as their signed versions.

https://github.com/SOCI/soci/commit/2a8840505ba67b4413c6cd9192965d95f1d0805c

b) Remove dt_unsigned_long and x_unsigned_long type constants.
There is no need for a separate type for "unsigned long" as we don't have
special types neither for "unsigned int" nor for "long" ...

https://github.com/SOCI/soci/commit/4f8bc05242e6e5dfc6c4d003049c44ca62890cd9

AFAIU, the action in 3) clears all the doubts discussed in 1) and also
moves the work in 2) out of scope of SOCI. Right?

I believe, it's important to summarise the current status of integer
types support in SOCI,
together with a few words of explanation why certain decisions have been made.
Such summary should go into docs.

I'd like to do it, but I realised the current status is unclear to myself too.
I know I can read the code, but the code comes second after some thoughts,
so I'd like to learn about the thoughts first, so I get where things come from.
Could anyone help me to figure it out?

A few basic questions I'd like to clarify in the docs:

1. What C++ integer types are supported (mapped) and usable with into/use?

2. What C++ integer types are not mapped? Why?

3. When we decide what integer types to map, which side has the higher
priority, SQL types or C++ types?
IOW, do we aim to cover as many SQL types as possible, then decide
how to map them to C++ types; or we aim to map as many C++ types
as possible, and then decide how those fit the SQL types?


Also, If the C++ types have higher priority, then what about Julian's proposal.
Wouldn't it make sense to switch the API to C99-based integer types?

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to