Author: mysqlpp
Date: Mon Dec 3 11:05:59 2007
New Revision: 1958
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1958&view=rev
Log:
Documented that you can now use vector<Row> with Query::storein()
Modified:
trunk/Wishlist
trunk/doc/userman/userman.dbx
Modified: trunk/Wishlist
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=1958&r1=1957&r2=1958&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Mon Dec 3 11:05:59 2007
@@ -31,10 +31,6 @@
- If we can get reference semantics everywhere, we can add
operator->() to subscript_iterator. It can't work with
value semantics.
-
- o Document that Query::storein() now works with raw Row objects.
- It used to fail because of the Result/Row lifetime issue,
- which didn't apply to SSQLS because of the data copy.
o Add userman chapter on connection options
Modified: trunk/doc/userman/userman.dbx
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/doc/userman/userman.dbx?rev=1958&r1=1957&r2=1958&view=diff
==============================================================================
--- trunk/doc/userman/userman.dbx (original)
+++ trunk/doc/userman/userman.dbx Mon Dec 3 11:05:59 2007
@@ -285,18 +285,34 @@
data structures, which can be accessed just as you would
any other structure. The results can be accessed through
the Row object, or you can ask the library to dump the
- results into a sequential or set-associative STL container
+ results into an STL container — sequential or
+ set-associative, it doesn't matter —
for you. Consider this:</para>
<programlisting>
-vector<mystruct> v;
-query << "SELECT * FROM mytable";
+vector<stock> v;
+query << "SELECT * FROM stock";
query.storein(v);
-for (vector<mystruct>::iterator it = v.begin(); it != v.end(); ++it) {
+for (vector<stock>::iterator it = v.begin(); it != v.end(); ++it) {
cout << "Price: " << it->price << endl;
}</programlisting>
<para>Isn't that slick?</para>
+
+ <para>If you don't want to create SSQLSes to match your
+ table structures, as of MySQL++ v3 you can now use
+ <classname>Row</classname> here instead:</para>
+
+ <programlisting>
+vector<mysqlpp::Row> v;
+query << "SELECT * FROM stock";
+query.storein(v);
+for (vector<mysqlpp::Row>::iterator it = v.begin(); it != v.end(); ++it)
{
+ cout << "Price: " << it->at(3) << endl;
+}</programlisting>
+
+ <para>It lacks a certain syntactic elegance, but it has
its
+ uses.</para>
</sect3>
</sect2>
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits