Using Data Sources

    While models expose a common API for your application to manipulate data, the purpose of a data source is to manage the direct connection details for a specific data storage medium. Apart from providing a common way to read and write, models use data sources to connect to, disconnect from, and describe their underlying services.

    • SQLite3
    • MongoDB

    Most of the time, using a data source is an automatic part of setting up a connection to your data store. This is usually done in the bootstrap file:

    Adapters are usually subclasses of . Once these connections have been made, the data source is available to your models. Since one of the connections defined above is named , newly created models will automatically use that connection and its related data source adapter.