[vtk-developers] Re: vtkSQLDatabase

David C Thompson dcthomp at sandia.gov
Wed Nov 28 16:09:01 EST 2007


On Wed, 2007-11-28 at 15:58 -0500, Sebastien BARRE wrote:
> At 11/28/2007 03:50 PM, David C Thompson wrote:
> > > ... but I also second Andy's opinion, be careful about wrapping,
> > > please do take into account that people will want to use this
> > > framework from Tcl, Python, etc, you can't just BTX/ETX.
> >OK. How about a class like this:
> >
> >class vtkSQLDatabaseSchema : public vtkObject
> >{
> >public:
> >   virtual int AddTable( const char* tableName );
> >   virtual int AddColumnToTable( const char* tableName,
> >     const char* colName, int colType, int colSize,
> >     const char* colAttribs );
> >   virtual int AddIndexToTable( const char* tableName,
> >     const char* iName, int iType,
> >     const char* foreignTableName=0, const char* foreignIndexName=0 );
> >   virtual int AddColumnToIndex( const char* tableName,
> >     const char* iName, const char* colName );
> >   virtual int AddTriggerToTable( const char* tableName,
> >     const char* tName, int tType, const char* tAction );
> >   // ... and similar Get{Column,Index,Trigger} calls.
> >};
> >That could be wrapped and is a single class instead of one for Tables,
> >one for Columns, etc. Some extra macros in C++ (like those in my first
> >e-mail) would make it possible to declare a schema in a concise way.
> 
> Sounds good to me!
> (besides the optional args / default values, which I don't think will wrap).

OK. We'll split those into

virtual int AddIndexToTable( const char* tableName,
  const char* iName, int iType );

and

virtual int AddIndexToTable(
  const char* tableName, const char* iName,
  const char* foreignTableName, const char* foreignIndexName );

Perhaps instead of taking tableName, etc., the routines should take an
integer identifying the table, etc. as returned by AddTable,
AddIndexToTable, etc.

	David




More information about the vtk-developers mailing list