]> Some of my projects - libferris.git/commitdiff
pqxx fixes
authorAPTX <marek321@gmail.com>
Fri, 6 Apr 2012 16:07:14 +0000 (12:07 -0400)
committerAPTX <marek321@gmail.com>
Fri, 27 Apr 2012 21:57:41 +0000 (17:57 -0400)
Ferris/FCA.cpp
apps/fca/ferris-create-fca-tree.cpp
plugins/context/postgresql/libferrispostgresql.cpp
plugins/eaindexers/postgresql/libeaindexpostgresql.cpp

index a32b030124351123993fd992e89b04da97708f84..11c55233d522e4e11a47e8c08d1d3524051cd07a 100644 (file)
@@ -48,6 +48,7 @@
 #include <pqxx/tablereader>
 #include <pqxx/tablewriter>
 #include <pqxx/result>
+#include <pqxx/field>
 #include <pqxx/cursor>
 #include <fstream>
 
@@ -1660,7 +1661,7 @@ namespace Ferris
         }
 
 #ifdef HAVE_LIBPQXX
-        static stringlist_t PGArrayToStringList( const result::field& s, stringlist_t& ret )
+        static stringlist_t PGArrayToStringList( const pqxx::field& s, stringlist_t& ret )
         {
             string str;
             s.to(str);
@@ -2667,8 +2668,8 @@ namespace Ferris
             {
                 int colNum = 0;
                 result::const_iterator firsttuple     = res.begin();
-                result::tuple::const_iterator e       = firsttuple->end();
-                for( result::tuple::const_iterator cur = firsttuple->begin();
+                tuple::const_iterator e       = firsttuple->end();
+                for( tuple::const_iterator cur = firsttuple->begin();
                      cur != e; ++cur )
                 {
                     string name = cur->name();
@@ -2729,8 +2730,8 @@ namespace Ferris
                     fh_concept ivc = m_conceptFactory_func( this, maxItemSetSizeInBits );
                 
                     int colNum = 0;
-                    result::tuple::const_iterator e = iter->end();
-                    for( result::tuple::const_iterator cur = iter->begin();
+                    tuple::const_iterator e = iter->end();
+                    for( tuple::const_iterator cur = iter->begin();
                          cur != e; ++cur )
                     {
                         string name = cur->name();
@@ -2856,9 +2857,9 @@ namespace Ferris
                 for( result::const_iterator iter = res.begin(); iter != res.end(); ++iter )
                 {
                     int id = -1;
-                    result::field idf       = (*iter)[ "id"  ];
-                    result::field parentsf  = (*iter)[ "lattice_parents"  ];
-                    result::field childrenf = (*iter)[ "lattice_children" ];
+                    pqxx::field idf       = (*iter)[ "id"  ];
+                    pqxx::field parentsf  = (*iter)[ "lattice_parents"  ];
+                    pqxx::field childrenf = (*iter)[ "lattice_children" ];
                     idf.to( id );
         
                     LG_FCA_D << " id:" << id << " parents:" << parentsf.c_str() << endl;
@@ -4518,8 +4519,8 @@ namespace Ferris
 
             // The mdi 'hint' only works if the SQL query selects in order.
 //            m_md_t::iterator mdi = m_md.end();
-            result::tuple::const_iterator e = iter->end();
-            for( result::tuple::const_iterator cur = iter->begin();
+            tuple::const_iterator e = iter->end();
+            for( tuple::const_iterator cur = iter->begin();
                  cur != e; ++cur )
             {
                 const char* name = cur->name();
@@ -4786,8 +4787,8 @@ namespace Ferris
                 if( !res.empty() )
                 {
                     result::const_iterator ri = res.begin();
-                    result::tuple::const_iterator e = ri->end();
-                    for( result::tuple::const_iterator cur = ri->begin(); cur != e; ++cur )
+                    tuple::const_iterator e = ri->end();
+                    for( tuple::const_iterator cur = ri->begin(); cur != e; ++cur )
                     {
                         string       name = cur->name();
                         const oid coltype = cur->type();
index e7d36b1429da5252b2ccd83d6e185b80b40c81a5..b722dbdf7dd1590316f98fd07746beefd9270775 100644 (file)
@@ -137,8 +137,8 @@ public:
                 result::const_iterator c = res.begin();
                 if( c != res.end() )
                 {
-                    result::tuple::const_iterator e = c->end();
-                    for( result::tuple::const_iterator cur = c->begin();
+                    ::pqxx::tuple::const_iterator e = c->end();
+                    for( ::pqxx::tuple::const_iterator cur = c->begin();
                          cur != e; ++cur )
                     {
                         string name = cur->name();
@@ -447,7 +447,7 @@ int main( int argc, char** argv )
             work trans( con, "getting the schema..." );
             result res = trans.exec( "select * from docmap where docid < 0" );
 
-            result::tuple::size_type res_col_sz = res.columns();
+            ::pqxx::tuple::size_type res_col_sz = res.columns();
             for( int i=0; i<res_col_sz; ++i )
             {
                 columns_in_docmap.insert( res.column_name( i ) );
index 6a5f89a8ca91b1e74e8ab987fa33944d69f21c26..73686ba8664507fbc7e4139d5f7dc03b36f819e0 100644 (file)
@@ -177,8 +177,8 @@ namespace Ferris
         
         void setIter( result::const_iterator& row )
             {
-                result::tuple::const_iterator e = row->end();
-                for( result::tuple::const_iterator cur = row->begin(); cur != e; ++cur )
+                ::pqxx::tuple::const_iterator e = row->end();
+                for( ::pqxx::tuple::const_iterator cur = row->begin(); cur != e; ++cur )
                 {
                     string k = cur->name();
                     if( !k.length() )
@@ -226,8 +226,8 @@ namespace Ferris
                 {
 #define SLEA tryAddStateLessAttribute
 
-                    result::tuple::const_iterator e = m_iter->end();
-                    for( result::tuple::const_iterator cur = m_iter->begin(); cur != e; ++cur )
+                    ::pqxx::tuple::const_iterator e = m_iter->end();
+                    for( ::pqxx::tuple::const_iterator cur = m_iter->begin(); cur != e; ++cur )
                     {
                         string k = cur->name();
                         if( !k.length() )
@@ -401,8 +401,8 @@ namespace Ferris
                 for( result::const_iterator iter = res.begin(); iter != res.end(); ++iter )
                 {
                     virgin = true;
-                    result::tuple::const_iterator e = iter->end();
-                    for( result::tuple::const_iterator cur = iter->begin();
+                    ::pqxx::tuple::const_iterator e = iter->end();
+                    for( ::pqxx::tuple::const_iterator cur = iter->begin();
                          cur != e; ++cur )
                     {
                         if(!virgin) ret << ",";
@@ -516,7 +516,7 @@ namespace Ferris
                     LG_PG_D << "read() sql:" << setupQuery() << endl;
                     result res = trans.exec( setupQuery() );
 
-                    for (result::tuple::size_type c = 0; c < res.columns(); ++c)
+                    for (::pqxx::tuple::size_type c = 0; c < res.columns(); ++c)
                     {
                         string k= res.column_name(c);
                         if( !k.length() )
@@ -703,7 +703,7 @@ namespace Ferris
                     result res = trans.exec( setupQuery() );
                     LG_PG_D << "DeterminePrimaryKey(with sql) have result..." << endl;
 
-                    for (result::tuple::size_type c = 0; c < res.columns(); ++c)
+                    for (::pqxx::tuple::size_type c = 0; c < res.columns(); ++c)
                     {
                         string k= res.column_name(c);
                         if( !k.length() )
index e2462a7d020c6a3d016d2f21b374fefd21a5ddc8..c131a8eaef7a189f37a9507bc0a86e496edc5cc7 100644 (file)
@@ -4243,7 +4243,7 @@ namespace Ferris
                 c[0].to( earl );
                 m_urlcache_ref row = new m_urlcache_t;
                 
-                for ( result::tuple::const_iterator ti = c->begin(); ti != c->end(); ++ti )
+                for ( ::pqxx::tuple::const_iterator ti = c->begin(); ti != c->end(); ++ti )
                 {
                     string v = ti->c_str();
                     row->insert( make_pair( ti->name(), v ) );