31 #ifndef vtkQtSQLDatabase_h 32 #define vtkQtSQLDatabase_h 36 #if (QT_EDITION & QT_MODULE_SQL) 38 #include "vtkGUISupportQtSQLModule.h" 41 #include <QtSql/QSqlDatabase> 58 bool Open(
const char* password)
override;
63 void Close()
override;
97 void SetColumnsTable(
const char* table);
120 return this->DatabaseType;
122 vtkSetStringMacro(DatabaseType);
129 vtkSetStringMacro(HostName);
130 vtkGetStringMacro(HostName);
137 vtkSetStringMacro(UserName);
138 vtkGetStringMacro(UserName);
145 vtkSetStringMacro(DatabaseName);
146 vtkGetStringMacro(DatabaseName);
153 vtkSetStringMacro(ConnectOptions);
154 vtkGetStringMacro(ConnectOptions);
161 vtkSetClampMacro(Port,
int, 0, 65535);
162 vtkGetMacro(Port,
int);
186 char* ConnectOptions;
188 QSqlDatabase QtDatabase;
216 #endif // (QT_EDITION & QT_MODULE_SQL) 217 #endif // vtkQtSQLDatabase_h Wrapper around std::string to keep symbols short.
static vtkSQLDatabase * CreateFromURL(const char *URL)
Create a the proper subclass given a URL.
virtual const char * GetDatabaseType()=0
Get the type of the database (e.g.
virtual bool IsSupported(int vtkNotUsed(feature))
Return whether a feature is supported by the database.
virtual bool Open(const char *password)=0
Open a new connection to the database.
virtual bool ParseURL(const char *url)=0
Subclasses should override this method to determine connection parameters given the URL...
virtual bool HasError()=0
Did the last operation generate an error.
a vtkAbstractArray subclass for strings
virtual vtkStdString GetURL()=0
Get the URL of the database.
virtual vtkStringArray * GetRecord(const char *table)=0
Get the list of fields for a particular table.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
maintain a connection to an sql database
query class associated with vtkQtSQLDatabase
virtual void Close()=0
Close the connection to the database.
a simple class to control print indentation
virtual vtkSQLQuery * GetQueryInstance()=0
Return an empty query on this database.
virtual bool IsOpen()=0
Return whether the database has an open connection.
virtual const char * GetLastErrorText()=0
Get the last error text from the database I'm using const so that people do NOT use the standard vtkG...
executes an sql query and retrieves results
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual vtkStringArray * GetTables()=0
Get the list of tables from the database.
maintains a connection to an sql database