Active Record
About this...
An `Active Record` is a model that stores an in-memory representation of a database row or document.
You know Sequelize, TypeORM, and Mongoose?
Those are all ORMs. When you return an instance of a row (or document), being able to make changes to the database row (that the instance references) is a popular usage of the Active Record pattern.
The Active Record pattern was initially documented by Martin Fowler
// Updating the 'name' column of a user using Sequelize.
const user = await User.find({ where: { user_id: 1 }});
await user.update({ name: 'Don Draper' });
Using instances of row objects returned from the ORM technology of our choice, we can Create, Read, Update and Delete instances of pretty much anything inside of the database.
Pretty cool!
Enjoying so far? Join 15000+ Software Essentialists getting my posts delivered straight to your inbox each week. I won't spam ya. 🖖

0 Comments
Commenting has been disabled for now. To ask questions and discuss this post, join the community.