Using a data model for database access