Architecture - Best Practices - To retrieve data from database

When i should go for direct database connection to get the data from database vs REST API to get data from database.

What are the pros & cons of each approach. Detailed help is highly appreciated.

  Discussion posts and replies are publicly visible