ORM stands for Object Relational Mapping
It is used to interact with databases using code instead of raw SQL π§
In simple words
ORM lets you
work with database tables as objects π¦
Without ORM β
β’ Too much raw SQL
β’ Repeated database code
β’ Harder maintenance
π§ What ORM Does
β’ Maps tables to objects π
β’ Converts code to SQL automatically βοΈ
β’ Handles relationships between tables π
β’ Simplifies database operations π§©
π Popular ORM Tools
β’ Prisma
β’ Sequelize
β’ TypeORM
β’ Hibernate
π Real World Usage
β’ User management systems
β’ E commerce applications
β’ Backend APIs
β’ Large scale databases
π How ORM Works
Developer writes code βοΈ
ORM converts it to SQL βοΈ
Database executes query ποΈ
Result is returned as objects π©
π» Example: Using ORM Style Code
// Instead of writing SQL
User.create({
name: "Ravi",
email: "ravi@example.com"
});