I think it would be good to start a discussion to try to identify what, if any, functionality is missing from the DAL in the context of indices and constraints and whether it is worth filling the gap(s).
Terminology is not always consistent but I think that the following definitions are worthwhile: constraint: a mechanism to restrict the content of the database index: a mechanism to allow speedier retrieval of content from the database >From a personal point of view, I consider the 'index' requirement secondary to the 'constraint' requirement. So taking constraint first: PRIMARY: catered for as the primary key on web2py tables is always 'id' UNIQUE: single column unique constraints are handled by the SQLField 'unique' attribute Multi-column unique constraints are not handled currently. FOREIGN: handled by the 'references' attribute linking tables by 'id' columns Is it necessary to support other foreign constraints (other columns, multiple columns)? Personally, I don't think so. Other views? CHECK: a database-level version of requires - not supported by MySQL yet, I don't know about other dbs Personally, I would vote to implement multi-column unique constraints so that data integrity can be specified completely using DAL syntax without the need for native SQL. I don't have a requirement for different foreign keys and 'check' is perhaps sparsely supported. RE indices: I guess the basic requirement is to be be able to specify one or more columns and for each column to specify ascending or descending sequence. The next step is to be able to specify each column as a substring. Personally, I don't have an urgent need to support indices (other than by executesql). In retrospect, that seems like a long post to propose adding multi- column unique constraints to the DAL but I'd be interested to read other people's views. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---