------------------------------------------------------------------------------
| 190 | |
| 191 | //------------------------------------------------------------------------------ |
| 192 | int vtkSQLDatabaseSchema::AddIndexToTable(int tblHandle, int idxType, const char* idxName) |
| 193 | { |
| 194 | if (tblHandle < 0 || tblHandle >= this->GetNumberOfTables()) |
| 195 | { |
| 196 | vtkErrorMacro("Cannot add index to non-existent table " << tblHandle); |
| 197 | return -1; |
| 198 | } |
| 199 | |
| 200 | int idxHandle = static_cast<int>(this->Internals->Tables[tblHandle].Indices.size()); |
| 201 | this->Internals->Tables[tblHandle].Indices.resize(idxHandle + 1); |
| 202 | vtkSQLDatabaseSchemaInternals::Index* index = |
| 203 | &this->Internals->Tables[tblHandle].Indices[idxHandle]; |
| 204 | index->Type = static_cast<DatabaseIndexType>(idxType); |
| 205 | index->Name = idxName; |
| 206 | return idxHandle; |
| 207 | } |
| 208 | |
| 209 | //------------------------------------------------------------------------------ |
| 210 | int vtkSQLDatabaseSchema::AddTriggerToTable( |
no test coverage detected