46 #ifndef vtkSQLDatabaseSchema_h
47 #define vtkSQLDatabaseSchema_h
49 #include "vtkIOSQLModule.h"
57 #define VTK_SQL_ALLBACKENDS "*" // works for all backends
58 #define VTK_SQL_MYSQL "vtkMySQLDatabase"
59 #define VTK_SQL_POSTGRESQL "vtkPostgreSQLDatabase"
60 #define VTK_SQL_SQLITE "vtkSQLiteDatabase"
62 class vtkSQLDatabaseSchemaInternals;
130 virtual int AddPreamble(
131 const char* preName,
const char* preAction,
137 virtual int AddTable(
const char* tblName );
145 virtual int AddColumnToTable(
146 int tblHandle,
int colType,
const char* colName,
147 int colSize,
const char* colAttribs );
149 const char* tblName,
int colType,
const char* colName,
150 int colSize,
const char* colAttribs )
152 return this->AddColumnToTable( this->GetTableHandleFromName( tblName ),
153 colType, colName, colSize, colAttribs );
163 virtual int AddIndexToTable(
164 int tblHandle,
int idxType,
const char* idxName );
166 const char* tblName,
int idxType,
const char* idxName )
168 return this->AddIndexToTable( this->GetTableHandleFromName( tblName ),
179 virtual int AddColumnToIndex(
int tblHandle,
int idxHandle,
int colHandle );
181 const char* tblName,
const char* idxName,
const char* colName )
183 int tblHandle = this->GetTableHandleFromName( tblName );
184 return this->AddColumnToIndex( tblHandle,
185 this->GetIndexHandleFromName( tblName, idxName ),
186 this->GetColumnHandleFromName( tblName, colName ) );
197 virtual int AddTriggerToTable(
198 int tblHandle,
int trgType,
const char* trgName,
201 const char* tblName,
int trgType,
const char* trgName,
204 return this->AddTriggerToTable( this->GetTableHandleFromName( tblName ),
205 trgType, trgName, trgAction, trgBackend );
221 virtual int AddOptionToTable(
222 int tblHandle,
const char* optStr,
225 const char* tblName,
const char* optStr,
228 return this->AddOptionToTable( this->GetTableHandleFromName( tblName ),
229 optStr, optBackend );
236 int GetPreambleHandleFromName(
const char* preName );
241 const char* GetPreambleNameFromHandle(
int preHandle );
246 const char* GetPreambleActionFromHandle(
int preHandle );
251 const char* GetPreambleBackendFromHandle(
int preHandle );
256 int GetTableHandleFromName(
const char* tblName );
261 const char* GetTableNameFromHandle(
int tblHandle );
266 int GetIndexHandleFromName(
const char* tblName,
const char* idxName );
271 const char* GetIndexNameFromHandle(
int tblHandle,
int idxHandle );
276 int GetIndexTypeFromHandle(
int tblHandle,
int idxHandle );
281 const char* GetIndexColumnNameFromHandle(
282 int tblHandle,
int idxHandle,
int cnmHandle );
287 int GetColumnHandleFromName(
const char* tblName,
const char* colName );
292 const char* GetColumnNameFromHandle(
int tblHandle,
int colHandle );
297 int GetColumnTypeFromHandle(
int tblHandle,
int colHandle );
302 int GetColumnSizeFromHandle(
int tblHandle,
int colHandle );
307 const char* GetColumnAttributesFromHandle(
int tblHandle,
int colHandle );
312 int GetTriggerHandleFromName(
const char* tblName,
const char* trgName );
317 const char* GetTriggerNameFromHandle(
int tblHandle,
int trgHandle );
322 int GetTriggerTypeFromHandle(
int tblHandle,
int trgHandle );
327 const char* GetTriggerActionFromHandle(
int tblHandle,
int trgHandle );
332 const char* GetTriggerBackendFromHandle(
int tblHandle,
int trgHandle );
337 const char* GetOptionTextFromHandle(
int tblHandle,
int optHandle );
342 const char* GetOptionBackendFromHandle(
int tblHandle,
int trgHandle );
352 int GetNumberOfPreambles();
357 int GetNumberOfTables();
362 int GetNumberOfColumnsInTable(
int tblHandle );
367 int GetNumberOfIndicesInTable(
int tblHandle );
372 int GetNumberOfColumnNamesInIndex(
int tblHandle,
int idxHandle );
377 int GetNumberOfTriggersInTable(
int tblHandle );
382 int GetNumberOfOptionsInTable(
int tblHandle );
388 vtkSetStringMacro(Name);
397 INDEX_COLUMN_TOKEN = 65,
398 END_INDEX_TOKEN = 75,
433 int AddTableMultipleArguments(
const char* tblName, ... );
448 #endif // vtkSQLDatabaseSchema_h
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int AddTriggerToTable(const char *tblName, int trgType, const char *trgName, const char *trgAction, const char *trgBackend=VTK_SQL_ALLBACKENDS)
Add a (possibly backend-specific) trigger action to a table.
virtual int AddColumnToTable(const char *tblName, int colType, const char *colName, int colSize, const char *colAttribs)
Add a column to table.
represent an SQL database schema
DatabaseColumnType
Basic data types for database columns.
a simple class to control print indentation
DatabaseTriggerType
Events where database triggers can be registered.
#define VTK_SQL_ALLBACKENDS
DatabaseIndexType
Types of indices that can be generated for database tables.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
virtual int AddColumnToIndex(const char *tblName, const char *idxName, const char *colName)
Add a column to a table index.
virtual int AddOptionToTable(const char *tblName, const char *optStr, const char *optBackend=VTK_SQL_ALLBACKENDS)
Add (possibly backend-specific) text to the end of a CREATE TABLE (...) statement.
virtual int AddIndexToTable(const char *tblName, int idxType, const char *idxName)
Add an index to table.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
class vtkSQLDatabaseSchemaInternals * Internals