I have a task of implementing around 4 custom tables in Drupal. They will contain data imported from outside and this data will be displayed in blocks as list of links (very simple SELECT statements, no formatting).

I will probably write a class to load them (from csv and from another web page) and to provide the block display, but I am wondering if this should be done in a completely custom way or maybe it would be beneficial to use the Drupal schema api to define these tables. They won't be edited by users, they will be loaded by program and only displayed in a block, the database will be MySQL forever. Does it make sense to use schema api? Is there any general suggestion how such custom tables should be treated in Drupal to integrate well?

Comments

goron’s picture

Always use the Schema API for custom tables.