[one-users] use postgres instead of sqlite..

Ruben S. Montero rubensm at dacya.ucm.es
Fri Jul 24 08:27:25 PDT 2009


Hi,

The access to the database is performed by the SqliteDB class, look at
include/SqliteDB.h:

* The constructor of this class opens the data base, that could be
replaced with the connection to the postgres server.

* Then every thing is handled with the exec functions that receives
and SQL statement and a callback function to be executed  for each
column. This could be the tricky part as sqlite3 queries allows you to
do the query and process the results in one call. You sould do
PgConnection::Exec and then iterate through the PgDatabase::Tuples()
executing the callback.

* sqlite * db pointer should be by a PgDatabase

This class was designed so it coul be derived in a future from an
abstract DataBase class so, in principle, the code was designed to
implement several DB backends...

Cheers

Ruben

On Wed, Jul 22, 2009 at 6:54 PM, Pallab
Chakrabarty<pchakrabarty at spikesource.com> wrote:
>
>
> Hi,
>
>
>
> I want to use postgres instead of sqlite, kindly help to understand the
> changes required for that..
>
>
>
>
>
> - regards
>    Pallab
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>



-- 
+---------------------------------------------------------------+
 Dr. Ruben Santiago Montero
 Associate Professor
 Distributed System Architecture Group (http://dsa-research.org)

 URL:    http://dsa-research.org/doku.php?id=people:ruben
 Weblog: http://blog.dsa-research.org/?author=7

 GridWay, http://www.gridway.org
 OpenNebula, http://www.opennebula.org
+---------------------------------------------------------------+


More information about the Users mailing list