45 #ifndef vtkSQLDatabaseSchema_h
46 #define vtkSQLDatabaseSchema_h
56 #define VTK_SQL_ALLBACKENDS "*" // works for all backends
57 #define VTK_SQL_MYSQL "vtkMySQLDatabase"
58 #define VTK_SQL_POSTGRESQL "vtkPostgreSQLDatabase"
59 #define VTK_SQL_SQLITE "vtkSQLiteDatabase"
61 class vtkSQLDatabaseSchemaInternals;
126 virtual int AddPreamble(
127 const char* preName,
const char* preAction,
132 virtual int AddTable(
const char* tblName );
137 virtual int AddColumnToTable(
138 int tblHandle,
int colType,
const char* colName,
139 int colSize,
const char* colAttribs );
141 const char* tblName,
int colType,
const char* colName,
142 int colSize,
const char* colAttribs )
144 return this->AddColumnToTable( this->GetTableHandleFromName( tblName ),
145 colType, colName, colSize, colAttribs );
152 virtual int AddIndexToTable(
153 int tblHandle,
int idxType,
const char* idxName );
155 const char* tblName,
int idxType,
const char* idxName )
157 return this->AddIndexToTable( this->GetTableHandleFromName( tblName ),
165 virtual int AddColumnToIndex(
int tblHandle,
int idxHandle,
int colHandle );
167 const char* tblName,
const char* idxName,
const char* colName )
169 int tblHandle = this->GetTableHandleFromName( tblName );
170 return this->AddColumnToIndex( tblHandle,
171 this->GetIndexHandleFromName( tblName, idxName ),
172 this->GetColumnHandleFromName( tblName, colName ) );
181 virtual int AddTriggerToTable(
182 int tblHandle,
int trgType,
const char* trgName,
185 const char* tblName,
int trgType,
const char* trgName,
188 return this->AddTriggerToTable( this->GetTableHandleFromName( tblName ),
189 trgType, trgName, trgAction, trgBackend );
200 virtual int AddOptionToTable(
201 int tblHandle,
const char* optStr,
204 const char* tblName,
const char* optStr,
207 return this->AddOptionToTable( this->GetTableHandleFromName( tblName ),
208 optStr, optBackend );
213 int GetPreambleHandleFromName(
const char* preName );
216 const char* GetPreambleNameFromHandle(
int preHandle );
219 const char* GetPreambleActionFromHandle(
int preHandle );
222 const char* GetPreambleBackendFromHandle(
int preHandle );
225 int GetTableHandleFromName(
const char* tblName );
228 const char* GetTableNameFromHandle(
int tblHandle );
232 int GetIndexHandleFromName(
const char* tblName,
const char* idxName );
235 const char* GetIndexNameFromHandle(
int tblHandle,
int idxHandle );
238 int GetIndexTypeFromHandle(
int tblHandle,
int idxHandle );
243 const char* GetIndexColumnNameFromHandle(
244 int tblHandle,
int idxHandle,
int cnmHandle );
249 int GetColumnHandleFromName(
const char* tblName,
const char* colName );
253 const char* GetColumnNameFromHandle(
int tblHandle,
int colHandle );
257 int GetColumnTypeFromHandle(
int tblHandle,
int colHandle );
261 int GetColumnSizeFromHandle(
int tblHandle,
int colHandle );
265 const char* GetColumnAttributesFromHandle(
int tblHandle,
int colHandle );
269 int GetTriggerHandleFromName(
const char* tblName,
const char* trgName );
273 const char* GetTriggerNameFromHandle(
int tblHandle,
int trgHandle );
277 int GetTriggerTypeFromHandle(
int tblHandle,
int trgHandle );
281 const char* GetTriggerActionFromHandle(
int tblHandle,
int trgHandle );
285 const char* GetTriggerBackendFromHandle(
int tblHandle,
int trgHandle );
289 const char* GetOptionTextFromHandle(
int tblHandle,
int optHandle );
293 const char* GetOptionBackendFromHandle(
int tblHandle,
int trgHandle );
299 int GetNumberOfPreambles();
302 int GetNumberOfTables();
305 int GetNumberOfColumnsInTable(
int tblHandle );
308 int GetNumberOfIndicesInTable(
int tblHandle );
312 int GetNumberOfColumnNamesInIndex(
int tblHandle,
int idxHandle );
315 int GetNumberOfTriggersInTable(
int tblHandle );
318 int GetNumberOfOptionsInTable(
int tblHandle );
322 vtkSetStringMacro(Name);
323 vtkGetStringMacro(Name);
332 INDEX_COLUMN_TOKEN = 65,
333 END_INDEX_TOKEN = 75,
365 int AddTableMultipleArguments(
const char* tblName, ... );
383 #endif // vtkSQLDatabaseSchema_h
abstract base class for most VTK objects
virtual int AddTriggerToTable(const char *tblName, int trgType, const char *trgName, const char *trgAction, const char *trgBackend=VTK_SQL_ALLBACKENDS)
virtual int AddColumnToTable(const char *tblName, int colType, const char *colName, int colSize, const char *colAttribs)
represent an SQL database schema
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
#define VTK_SQL_ALLBACKENDS
virtual int AddColumnToIndex(const char *tblName, const char *idxName, const char *colName)
virtual int AddOptionToTable(const char *tblName, const char *optStr, const char *optBackend=VTK_SQL_ALLBACKENDS)
virtual int AddIndexToTable(const char *tblName, int idxType, const char *idxName)
class vtkSQLDatabaseSchemaInternals * Internals