On 11.01.2010 15:59, Maciej Sobczak wrote:
> Hello,
>
> Konstantin Litvinenko wrote:
>
>>> What would be the added value?
>>> Please note that from all integer types available in C++, SOCI supports
>>> only some of them - the ones that were considered most useful.
>> Considered by who? Who is judge?
>
> The people who do the work?
So you say that developers decide not users. Am I right?
>
>> When using SOCI I always wondering why I can't use unsigned typed.
>
> You can. The unsigned long type is natively supported.
>
>> It is my decision when I need
>> unsigned or signed value. Database support only signed types because (that's
>> only my guess) unsigned
>> can be modeled by signed. But C++ allow me to use unsigned types and my
>> problem require to use
>> unsigned types. So why SOCI prevent unsigned types usage?
>
> Please note that SOCI exists on the border of C++ and database worlds.
> The fact that C++ allows to do something does not mean that it will
> automatically have a direct representation at the database level (and
> the other way round).
>
> Please note also that you might use the type conversion mechanism to
> adapt the types that are important in your particular case.
Okay. Please, can you explain why I can't do the following:
struct foo
{
unsigned int bar_;
unsigned short fee_;
}
void some_work(foo& var, SOCI::Session& db)
{
db << "select bar, fee from some_table where bar = 0 limit 1;",
into(var.bar_), into(var.fee_);
}
and must do
void some_work(foo& var, SOCI::Session& db)
{
unsigned long fee;
short fee_;
db << "select bar, fee from some_table where bar = 0 limit 1;", into(bar_),
into(fee_);
var.fee_ = fee;
var.bar = bar_;
}
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users