On 27 Jan 2007, at 12:17 AM, Metzler, David wrote:
I was wondering if the model code for the new forms API might be a good
place to start for syntax. Wouldn't it be cool if the way we talked
about data for the model portion of a form would be the same as the way
we talked about data in the schema? Or does that seem silly?
Might be useful, but the model portion is required for normal operation.
I don't know that we want to move the data structure to generate tables moved into the module
files at this point.
It is definitely an idea for the future though, although the primary use of this would probably
be for a query builder, and I just don't see Drupal 6 including a query builder.
There's a couple of major reasons that I still think functions are better than a single data structure however.
1) if we end up nesting with entities (and stuff like indexes, and relationships),
we will end up with a very deeply nested array which could be very easy to mess up.
2) individual commands (ie: create table, create index), allow us to use the same code for the updates too.
if the schema is documented in a big array, we will be in a situation where we have to maintain the commands
as well for use in updates.
Or we try to analyze changes in the array structure to generate the commands automatically. This is a direction
I don't think we should move towards, as there be dragons there.
3) easier to debug. nuff said.
--
Adrian