Logo ROOT   6.18/05
Reference Guide
TSQLiteServer.h
Go to the documentation of this file.
1// @(#)root/sqlite:$Id$
2// Author: o.freyermuth <o.f@cern.ch>, 01/06/2013
3
4/*************************************************************************
5 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TSQLiteServer
13#define ROOT_TSQLiteServer
14
15#include "TSQLServer.h"
16
17#if !defined(__CINT__)
18#include <sqlite3.h>
19#else
20struct sqlite3;
21#endif
22
23
24
25class TSQLiteServer : public TSQLServer {
26
27 private:
28 TString fSrvInfo; // Server info string
29 sqlite3 *fSQLite; // connection to SQLite DB
30
31 public:
32 TSQLiteServer(const char *db, const char *uid=NULL, const char *pw=NULL);
34
35 void Close(Option_t *opt="");
37 TSQLResult *Query(const char *sql);
38 Bool_t Exec(const char *sql);
39 TSQLStatement *Statement(const char *sql, Int_t = 100);
40 Bool_t HasStatement() const;
41 Int_t SelectDataBase(const char *dbname);
42 TSQLResult *GetDataBases(const char *wild = 0);
43 TSQLResult *GetTables(const char *dbname, const char *wild = 0);
44 TSQLResult *GetColumns(const char *dbname, const char *table, const char *wild = 0);
45 TSQLTableInfo *GetTableInfo(const char* tablename);
46 Int_t CreateDataBase(const char *dbname);
47 Int_t DropDataBase(const char *dbname);
48 Int_t Reload();
50 const char *ServerInfo();
51
52 ClassDef(TSQLiteServer,0); // Connection to SQLite DB
53};
54
55#endif
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
Int_t Shutdown()
Shutdown the database server.
TSQLTableInfo * GetTableInfo(const char *tablename)
Produces SQL table info.
void Close(Option_t *opt="")
Close connection to SQLite DB.
Bool_t Exec(const char *sql)
Execute SQL command which does not produce any result sets.
Bool_t HasStatement() const
We assume prepared statements work for all SQLite-versions.
TSQLStatement * Statement(const char *sql, Int_t=100)
Produce TSQLiteStatement.
TSQLResult * Query(const char *sql)
Execute SQL command.
TSQLResult * GetTables(const char *dbname, const char *wild=0)
List all tables in the specified database.
Int_t DropDataBase(const char *dbname)
Drop (i.e.
Int_t CreateDataBase(const char *dbname)
Create a database.
Bool_t StartTransaction()
submit "START TRANSACTION" query to database return kTRUE, if successful
TSQLResult * GetDataBases(const char *wild=0)
List all available databases.
Int_t Reload()
Reload permission tables.
const char * ServerInfo()
Return server info, must be deleted by user.
sqlite3 * fSQLite
Definition: TSQLiteServer.h:29
TSQLResult * GetColumns(const char *dbname, const char *table, const char *wild=0)
List all columns in specified table (database argument is ignored).
~TSQLiteServer()
Close SQLite DB.
Int_t SelectDataBase(const char *dbname)
Select a database.
TSQLiteServer(const char *db, const char *uid=NULL, const char *pw=NULL)
Open a connection to an SQLite DB server.
TString fSrvInfo
Definition: TSQLiteServer.h:28
Basic string class.
Definition: TString.h:131