D
D
driverx182018-12-27 21:59:46
ORM
driverx18, 2018-12-27 21:59:46

What is the difference between DBAL and ORM?

I always say that I use an ORM when I use queries like:
$this->select()->join()->where()->andWhere()
However, as I read on the resources, it looks more like DBAL. As I understand it, DBAL means that you don’t need to worry about which DBMS you use, you must build a query like the one I wrote above, specify your DBMS somewhere in the configs, and it will be able to write the correct query for you. Also, as I understand it, when using DBAL, not objects are returned, but arrays, for example, and when using ORM, they are always objects.
Actually I would like to understand, am I right or not?) What are the fundamental differences between DBAL and ORM?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Sedyshev, 2018-12-27
@driverx18

It is incorrect to compare warm with soft. So here: DBAL, as you correctly wrote, is an abstraction layer that represents a single interface for working with various database implementations.
ORM is a thing that allows you to work with objects and relationships in the database as with entities, without worrying about which tables and fields the entity is filled from.
The aforementioned Doctrine also has its own DBAL, but that doesn't stop it from being an ORM :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question