Go to the documentation of this file.
49 #ifndef vtkPostgreSQLDatabase_h
50 #define vtkPostgreSQLDatabase_h
52 #include "vtkIOPostgreSQLModule.h"
64 friend class vtkPostgreSQLQueryPrivate;
76 bool Open(
const char* password = 0 );
151 virtual void SetServerPort(
int );
160 vtkGetMacro(ServerPort,
int);
239 vtkSetStringMacro(DatabaseType);
240 vtkSetStringMacro(LastErrorText);
265 #define vtkSetStringPlusMTimeMacro(className,name,timeStamp) \
266 inline void className::Set##name (const char* _arg) \
268 vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting " << #name " to " << (_arg?_arg:"(null)") ); \
269 if ( this->name == NULL && _arg == NULL) { return;} \
270 if ( this->name && _arg && (!strcmp(this->name,_arg))) { return;} \
271 delete [] this->name; \
274 size_t n = strlen(_arg) + 1; \
275 char *cp1 = new char[n]; \
276 const char *cp2 = (_arg); \
278 do { *cp1++ = *cp2++; } while ( --n ); \
285 this->timeStamp.Modified(); \
297 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): setting ServerPort to " << _arg );
307 #endif // vtkPostgreSQLDatabase_h
internal details of a connection to a PostgreSQL database
static vtkPostgreSQLDatabase * New()
bool IsSupported(int feature)
Return whether a feature is supported by the database.
virtual void SetPassword(const char *)
The user's password for connecting to the database server.
bool Open(const char *password=0)
Open a new connection to the database.
virtual int GetServerPortMinValue()
virtual vtkStdString GetColumnSpecification(vtkSQLDatabaseSchema *schema, int tblHandle, int colHandle)
Return the SQL string with the syntax to create a column inside a "CREATE TABLE" SQL statement.
record modification and/or execution time
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
bool IsOpen()
Return whether the database has an open connection.
virtual void Modified()
Update the modification time for this object.
maintain a connection to a PostgreSQL database
bool OpenInternal(const char *connectionOptions)
vtkPostgreSQLDatabasePrivate * Connection
void Close()
Close the connection to the database.
virtual void SetServerPort(int)
The port used for connecting to the database.
vtkStringArray * GetTables()
Get the list of tables from the database.
const char * GetClassName() const
Return the class name as a string.
virtual void SetConnectOptions(const char *)
Additional options for the database.
void Modified()
Set this objects time to the current time.
vtkTimeStamp ConnectionMTime
bool CreateDatabase(const char *dbName, bool dropExisting=false)
Create a new database, optionally dropping any existing database of the same name.
a simple class to control print indentation
vtkSQLQuery implementation for PostgreSQL databases
vtkStringArray * GetDatabases()
Return a list of databases on the server.
virtual bool HasError()
Did the last operation generate an error.
virtual int GetServerPortMaxValue()
void NullTrailingWhitespace(char *msg)
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
virtual bool ParseURL(const char *url)
Overridden to determine connection parameters given the URL.
vtkStringArray * GetRecord(const char *table)
Get the list of fields for a particular table.
represent an SQL database schema
void UpdateDataTypeMap()
Create or refresh the map from Postgres column types to VTK array types.
a vtkAbstractArray subclass for strings
bool DropDatabase(const char *dbName)
Drop a database if it exists.
#define vtkSetStringPlusMTimeMacro(className, name, timeStamp)
Wrapper around std::string to keep symbols short.
virtual void SetDatabaseName(const char *)
The name of the database to connect to.
virtual vtkStdString GetURL()
Get a URL referencing the current database connection.
virtual void SetUser(const char *)
The user name for connecting to the database server.
executes an sql query and retrieves results
const char * GetLastErrorText()
Get the last error text from the database.
virtual void SetHostName(const char *)
The database server host name.
vtkSQLQuery * GetQueryInstance()
Return an empty query on this database.
maintain a connection to an sql database