Ruby Preserves
summary
A tiny ORM called Ruby Preserves claims to keep the essence of mapping while staying 350 lines long and using raw SQL instead of a DSL; it implements the Repository and Data Mapper patterns, supports has_many and belongs_to with eager-loading to avoid N+1, ties closely to Postgres, lacks ActiveModel and composable scopes, and works as a proof of concept rather than production-ready code while planning prepared statements and automatic mappings.
AI-written summary · about
chapters (23)
- 0:00Intro
- 0:20About Me
- 1:39Why?
- 2:57Opinion
- 5:30ActiveRecord
- 6:20Active Record Pattern
- 8:50Data Mapper Pattern
- 9:55Repository Pattern
- 11:08Ruby Preserves
- 11:36Domain Model
- 13:05Data Mapping
- 14:15Repository Methods
- 15:23Relationships - Has Many
- 16:22Relationships - Belongs To
- 17:16N+1 Queries
- 18:15Wrong Turns
- 19:22Relationships - JOINS
- 21:12Advantages - Size
- 22:09Disadvantages
- 23:34Further Work
- 26:01Alternatives
- 30:17Further Reading
- 31:18Feedback
related talks
35mPersisting Relations Across Time and Space
47mFaster, Better ORM with DataMapper
36m"Persistence pays off: a new look at rom-rb"
35mPersistence pays off: a new look at rom-rb
53mRuby Persistence in MagLev
40mPutting off Persistence
32mArel: The Ruby Relational Algebra Library
30mBuilding an ORM with AReL: Walking up the (AS)Tree.
