Object-Relational-Mapping diagram

What is Object-Relational-Mapping (ORM)?

The purpose of an ORM library is to translate data between a relational database and objects in your application. In other words, it’s the middle layer that helps you interact with the database, using a language of our choice, instead of using SQL.

SQL query might look something like this:

SELECT * FROM users WHERE username = 'FunkyLadybug';

The same query would look something like this using an ORM library:

Users.findAll({
where: {
username: 'FunkyLadybug'
}
});

Why should I use an ORM?

Irena Podgurski

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store