ROOT logo
// @(#)root/pgsql:$Id$
// Author: g.p.ciceri <gp.ciceri@acm.org> 01/06/2001

/*************************************************************************
 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TPgSQLServer
#define ROOT_TPgSQLServer

#ifndef ROOT_TSQLServer
#include "TSQLServer.h"
#endif

#include <map>
#include <string>

#if !defined(__CINT__)
#include <libpq-fe.h>
#else
struct PGconn;
#endif



class TPgSQLServer : public TSQLServer {

private:
   PGconn  *fPgSQL;    // connection to PgSQL server
   TString  fSrvInfo;  // Server info
   std::map<Int_t,std::string> fOidTypNameMap; // Map of oid to typname, used in GetTableInfo()
public:
   TPgSQLServer(const char *db, const char *uid, const char *pw);
   ~TPgSQLServer();

   void           Close(Option_t *opt="");
   TSQLResult    *Query(const char *sql);
   TSQLStatement *Statement(const char *sql, Int_t = 100);
   Bool_t         HasStatement() const;
   Int_t          SelectDataBase(const char *dbname);
   TSQLResult    *GetDataBases(const char *wild = 0);
   TSQLResult    *GetTables(const char *dbname, const char *wild = 0);
   TSQLResult    *GetColumns(const char *dbname, const char *table, const char *wild = 0);
   TSQLTableInfo *GetTableInfo(const char* tablename);
   Int_t          CreateDataBase(const char *dbname);
   Int_t          DropDataBase(const char *dbname);
   Int_t          Reload();
   Int_t          Shutdown();
   const char    *ServerInfo();

   ClassDef(TPgSQLServer,0)  // Connection to PgSQL server
};

#endif
 TPgSQLServer.h:1
 TPgSQLServer.h:2
 TPgSQLServer.h:3
 TPgSQLServer.h:4
 TPgSQLServer.h:5
 TPgSQLServer.h:6
 TPgSQLServer.h:7
 TPgSQLServer.h:8
 TPgSQLServer.h:9
 TPgSQLServer.h:10
 TPgSQLServer.h:11
 TPgSQLServer.h:12
 TPgSQLServer.h:13
 TPgSQLServer.h:14
 TPgSQLServer.h:15
 TPgSQLServer.h:16
 TPgSQLServer.h:17
 TPgSQLServer.h:18
 TPgSQLServer.h:19
 TPgSQLServer.h:20
 TPgSQLServer.h:21
 TPgSQLServer.h:22
 TPgSQLServer.h:23
 TPgSQLServer.h:24
 TPgSQLServer.h:25
 TPgSQLServer.h:26
 TPgSQLServer.h:27
 TPgSQLServer.h:28
 TPgSQLServer.h:29
 TPgSQLServer.h:30
 TPgSQLServer.h:31
 TPgSQLServer.h:32
 TPgSQLServer.h:33
 TPgSQLServer.h:34
 TPgSQLServer.h:35
 TPgSQLServer.h:36
 TPgSQLServer.h:37
 TPgSQLServer.h:38
 TPgSQLServer.h:39
 TPgSQLServer.h:40
 TPgSQLServer.h:41
 TPgSQLServer.h:42
 TPgSQLServer.h:43
 TPgSQLServer.h:44
 TPgSQLServer.h:45
 TPgSQLServer.h:46
 TPgSQLServer.h:47
 TPgSQLServer.h:48
 TPgSQLServer.h:49
 TPgSQLServer.h:50
 TPgSQLServer.h:51
 TPgSQLServer.h:52
 TPgSQLServer.h:53
 TPgSQLServer.h:54
 TPgSQLServer.h:55
 TPgSQLServer.h:56
 TPgSQLServer.h:57
 TPgSQLServer.h:58