The ActiveRecord pattern involves having an in-memory Object that can be manipulated for each row in a table:
part = Part.new()
part.name = "Part Name"
part.price = 20.34
part.save() # save to dbAt the .save() call, the calling code will materialize the object to the database:
INSERT INTO parts(name, price) VALUES('Part Name', 20.34);You can also query with it:
p = Part.find(0) # get the first partThe DataMapper pattern separates