Moshe Weitzman <weitzman@tejasa.com> writes:
actually, drupal core itself uses basic reflection on the users table. see user_fields(). ... this table definition API would help us extend that feature to other objects like $node and $term. Very nice for performance.
Yes. Just to spell this out, a hypothetical hook_schema_alter for foo.module: function foo_schema_alter(&$schema) { $schema['node']['cols'][] = array(/* define the foo column for nodes */); } Now, node_load and node_save automatically handle $node->foo, so foo_nodeapi doesn't have to do its own queries. Of course this only makes sense for data that applies to every node (a node type's custom columns should not (?) exist in the node table as they'd be NULL most of the time and we'd get a very wide table). Barry