Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

PGDBProperty Class Reference

DBProperty subclass for the PostgreSQL database. More...

#include <vos/metaobjects/property/pgdb_property.hh>

Inheritance diagram for PGDBProperty:

DBProperty LocalProperty Property MetaObject ObjectExciseListener List of all members.

Public Member Functions

Static Public Member Functions

Protected Attributes


Detailed Description

DBProperty subclass for the PostgreSQL database.

Warning:
The select query must return a scalar value, currently. (If it returns multiple values, only the first field of the first row will be used.
From the VOS point of view, the PG Database is a backend to the property metaobject. From Postgres point of view, this is a frontend to the database; it is a very primitive one, essentially only doing SELECTs to read the data and UPDATEs (or INSERTs) to change it. You can talk to the database yourself, if you really want to, by using the queryDB() function, or by getting the connection handle with getConnectionHandle(). However, it must be said, Caveat Hackor.

Note:
this class will only be available on systems with the postgres development stuff (headers etc) installed, so you probably need to download and the source code from http://interreality.org/software/source.html and compile it yourself (after installing the PGSQL headers etc. of course) if you want to use this class.

Definition at line 78 of file pgdb_property.hh.


Constructor & Destructor Documentation

PGDBProperty::PGDBProperty MetaObject superobject  ) 
 

basic constructor

Definition at line 53 of file pgdb_property.cc.

Referenced by new_PGDBProperty().

PGDBProperty::~PGDBProperty  ) 
 

Destructoratorizer.

Closes database connection.

Definition at line 85 of file pgdb_property.cc.


Member Function Documentation

virtual void* PGDBProperty::getConnectionHandle  )  [inline, virtual]
 

Returns underlying database handle.

it will really be type PGconn*, simply typecast to fit interface.

Definition at line 114 of file pgdb_property.hh.

MetaObject* PGDBProperty::new_PGDBProperty MetaObject superobject,
const string &  type
[inline, static]
 

called by factory to create a new instance

Definition at line 101 of file pgdb_property.hh.

Referenced by registerExtenders().

void PGDBProperty::open const string &  dbinfo = ""  ) 
 

Open database.

Parameters:
dbinfo Informatino to pass to Posgres C library PGconn() function. if empty ("") or omitted, enironment variables and/or defaults are used.

Definition at line 60 of file pgdb_property.cc.

string PGDBProperty::queryDB const string &  query  )  throw (DBAccessError) [virtual]
 

Perform a query on the database, in Postgres' SQL.

XXX BUG: does not free 'result' when errors occur (just throws message)

Reimplemented from DBProperty.

Definition at line 96 of file pgdb_property.cc.

void PGDBProperty::registerExtenders  )  [inline, static]
 

Register PGDBProperty Metaobject extender.

You must also call Property::registerExtenders() for stuff to work!

Reimplemented from DBProperty.

Definition at line 107 of file pgdb_property.hh.


Member Data Documentation

PGconn* PGDBProperty::dbcon [protected]
 

Definition at line 83 of file pgdb_property.hh.

Referenced by getConnectionHandle(), open(), and ~PGDBProperty().


The documentation for this class was generated from the following files:
Generated on Tue Aug 12 03:55:55 2003 for Interreality Project - VOS by doxygen 1.3.2