Added some support for materials in the database API.