Backend

The task of the Jet DataModel backend is to translate all those entity and query definitions (which have the form of object instances) into SQL that the relational database understands. (Or theoretically it doesn't even have to be SQL and a relational database, but I'm digressing.) Quite specifically the backend in charge of this:

  • Creating database tables based on definitions
  • Edit/update database tables based on definitions
  • Creating and executing INSERT queries
  • Creating and executing UPDATE queries
  • Creating and executing DELETE queries
  • Creating and executing SELECT queries to determine the number of records
  • Creating and executing SELECT queries to load data
  • Converting result data to data types ready to be passed to entity instances

The backend must always inherit from the abstract class Jet\DataModel_Backend and must have its configuration definition, which inherits from the class Jet\DataModel_Backend_Config. The references of these classes provide additional details, including the ability to add your own backend.

Jet DataModel currently supports the following types of relational databases:

  • MariaDB / MySQL
    De facto standard ... An interesting aspect is the possibility to have a different connection to the database defined for writing and another for reading data (replication and so on).
  • SQLite
    Yes, this is almost unusable for a large online project. But I have my two private projects that take the form of local online tools, and there a thing like SQLite is useful, and a "full-fledged" relational database would be unnecessary - if not counterproductive.
  • PostgreSQL
  • MS SQL
  • Oracle support development is in progress

Previous chapter
Working with raw data
Next chapter
In depth