41 Error(
"TSQLiteServer",
"protocol in db argument should be sqlite it is %s",
49#ifndef SQLITE_OPEN_URI
50#define SQLITE_OPEN_URI 0x00000000
52#if SQLITE_VERSION_NUMBER >= 3005000
106 return Exec(
"BEGIN TRANSACTION");
127 return Exec(
"COMMIT TRANSACTION");
136 return Exec(
"ROLLBACK TRANSACTION");
147 Error(
"Query",
"not connected");
152 const char *tail =
nullptr;
155#if SQLITE_VERSION_NUMBER >= 3005000
164 if (tail && tail[0] !=
'\0')
165 Warning(
"Query",
"Don't use multiple queries, '%s' query was ignored", tail);
177 Error(
"Exec",
"not connected");
198 Error(
"SelectDataBase",
"SelectDataBase command makes no sense for SQLite!");
208 Error(
"GetDataBases",
"GetDataBases command makes no sense for SQLite!");
221 Error(
"GetTables",
"not connected");
225 TString sql =
"SELECT name FROM sqlite_master where type='table'";
245 Error(
"GetColumns",
"not connected");
250 Error(
"GetColumns",
"Not implementable for SQLite as a query with wildcard, use GetFieldNames() after SELECT instead!");
265 Error(
"GetTableInfo",
"not connected");
274 Error(
"GetTableInfo",
"could not query columns");
315 Error(
"CreateDataBase",
"CreateDataBase command makes no sense for SQLite!");
325 Error(
"DropDataBase",
"DropDataBase command makes no sense for SQLite!");
336 Error(
"Reload",
"not connected");
340 Error(
"Reload",
"not implemented");
351 Error(
"Shutdown",
"not connected");
355 Error(
"Shutdown",
"not implemented");
376 SetError(-1,
"no query string specified",
"Statement");
381 Error(
"Statement",
"not connected");
386 const char *tail =
nullptr;
389#if SQLITE_VERSION_NUMBER >= 3005000
398 if (tail && tail[0] !=
'\0')
399 Warning(
"Statement",
"Don't use multiple statements, '%s' statement was ignored", tail);
414 Error(
"ServerInfo",
"not connected");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void SetError(Int_t code, const char *msg, const char *method=nullptr)
set new values for error fields if method is specified, displays error message
virtual Bool_t IsConnected() const
Int_t SelectDataBase(const char *dbname) final
Select a database.
TSQLStatement * Statement(const char *sql, Int_t=100) final
Produce TSQLiteStatement.
Bool_t HasStatement() const final
We assume prepared statements work for all SQLite-versions.
Int_t DropDataBase(const char *dbname) final
Drop (i.e.
TSQLResult * GetTables(const char *dbname, const char *wild=nullptr) final
List all tables in the specified database.
Bool_t Commit() final
submit "COMMIT TRANSACTION" query to database return kTRUE, if successful
TSQLResult * Query(const char *sql) final
Execute SQL command.
Bool_t HasTransactionInFlight() final
returns kTRUE when transaction is running
const char * ServerInfo() final
Return server info, must be deleted by user.
Bool_t Rollback() final
submit "ROLLBACK TRANSACTION" query to database return kTRUE, if successful
TSQLResult * GetColumns(const char *dbname, const char *table, const char *wild=nullptr) final
List all columns in specified table (database argument is ignored).
Int_t Shutdown() final
Shutdown the database server.
Bool_t Exec(const char *sql) final
Execute SQL command which does not produce any result sets.
Int_t Reload() final
Reload permission tables.
TSQLResult * GetDataBases(const char *wild=nullptr) final
List all available databases.
Int_t CreateDataBase(const char *dbname) final
Create a database.
~TSQLiteServer()
Close SQLite DB.
void Close(Option_t *opt="") final
Close connection to SQLite DB.
TSQLiteServer(const char *db, const char *uid=nullptr, const char *pw=nullptr)
Open a connection to an SQLite DB server.
Bool_t StartTransaction() final
submit "BEGIN TRANSACTION" query to database return kTRUE, if successful
TSQLTableInfo * GetTableInfo(const char *tablename) final
Produces SQL table info.
const char * Data() const