ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] Interest in an ODBC library?
by Jonathan Wakely other posts by this author
Aug 18 2005 8:16AM messages near this date
Re: [boost] Interest in an ODBC library? | Re: [boost] Interest in an ODBC library?
SOURCE Caleb Epstein wrote:

>  On 8/18/05, Brock Peabody <brock.peabody@[...].com> wrote:
>  
>  > We could make abstract_row_set::get return an optional<field> instead of
>  > a field.  Then row::get_field could return an optional as well.
>  > 
>  > I'd suggest that row::get, however, continue its current behavior which
>  > is to return a default constructed value in the presence of null fields.
>  
>  I think the ability to detect NULL values for columns is a pretty
>  important one in any database interface.  Boost.Optional sounds like
>  the perfect solution from a design perspective, but might hurt
>  performance-wise.  What if there were a method like bool row::is_null
>  (unsigned int index)?

I think it's reasonable to have to ask whether it's NULL before fetching
the value, rather than using optional.

Some queries won't return NULLs, either because the column definition is
NOT NULL or because the query specified "IFNULL(..., ...)" so the user is
the best qualified to know whether it is necessary to test for NULL.

If they call get() then the library can assume they know there's a
non-NULL value there to get() and not worry about handling a NULL.

jon

-- 
"I always keep a supply of liquor handy in case I see a snake,
 which I also keep handy."
	- W.C. Fields
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Brian Braatz
Brock Peabody
Caleb Epstein
Brock Peabody
Caleb Epstein
Brock Peabody
Jonathan Wakely
Daryle Walker
Jonathan Wakely
Brock Peabody
Jonathan Wakely
Jonathan Wakely
Brock Peabody
Caleb Epstein
Caleb Epstein
Brock Peabody
Jonathan Wakely
Brock Peabody

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved