ORM

An ORM is a system to manipulate data from a database programatically. There are many ORMs that you can adapt and use in Mandarine, although, Mandarine has its own built-in ORM framework that gives you a unique experience because of Mandarine Query Language (MQL).

Concepts

  • Models / Entities

    • Classes that represent a table in your database, this class has columns (properties) and it will be used for your database to interact with your code and vice-versa.

  • Repositories

    • An abstract class that contains your queries as well as predefined queries such as save, findAll, deleteAll, countAll

    • Repositories can contain custom queries or MQL queries.

    • Repositories are Mandarine Components, but they are only used for database interaction purposes which means you they cannot receive injections as described here.

  • Proxy Method

    • A proxy method is a hidden processor for one or more of your methods.

    • Mandarine uses a proxy method to write & execute your database queries in order to avoid writing this kind of code on your application's layer.

    • Proxy methods are implemented behind mandarine repositories.

Mandarine data sources

Mandarine's built-in ORM framework only supports one native data source from your configuration's file. The ability to use two or more data sources and integrate them with your mandarine-powered application is not expected in the upcoming releases.

You can create your own services & processors for your database operations by using Mandarine components.

Dialects

See enum here

Currently, Mandarine's built-in ORM only supports:

  • PostgreSQL

Note that support for MySQL is expected to be added in upcoming weeks (See here).

Last updated