Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
By, Vipul Amler We all love ActiveRecord. Its amazing. But how exactly does ActiveRecord handle generating complex SQL queries? How Joins, Associations and Table Relations are handled? Most of this raw power comes from ARel. ARel is packed up with many features for complex query generation. Lets build our own ORM on top of ARel to see it in action. In the process we will also explore about how ActiveRecord hooks up with ARel. This talk describes Relational Algebra, Object and Collection modelling of ARel using a tiny ORM at its base. At the end of talk you will be equipped with better understanding of ARel and AR as an ORM. Help us caption & translate this video! http://amara.org/v/FUGX/
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this talk titled "Building an ORM with AReL: Walking up the (AS)Tree," Vipul Amler discusses the process of creating a tiny Object-Relational Mapping (ORM) library called 'Storm' using ARel, which is a SQL abstraction framework. The purpose of this presentation is to provide insights into how ActiveRecord generates complex SQL queries, and to explore the foundational aspects of ORMs. Key points include: - **Introduction to ORM**: Vipul explains what an ORM is and its role in bridging the gap between databases and programming languages, particularly Ruby. He mentions ActiveRecord as an example of an ORM that simplifies database interactions. - **Using ARel**: ARel is introduced as the underlying framework that will assist with query generation in the ORM. ARel employs an abstract syntax tree (AST) to manage complex SQL queries involving operations such as joins and unions. - **Basic ORM Structure**: The talk includes a walkthrough on setting up the basic components of the ORM, including defining models, setting up database connections (using Postgres), and implementing essential functionalities like attribute access and type casting. - **Key Features Implementation**: The process includes defining tables with ARel, setting up a schema cache, managing column definitions, and establishing a primary key sequence for record insertion. - **CRUD Operations**: Vipul elaborates on implementing fundamental CRUD (Create, Read, Update, Delete) operations within the ORM, detailing how to use ARel's capabilities to interact with the database efficiently. - **Demo and Testing**: The presentation highlights a practical demonstration of building the ORM step-by-step, and talks about setting up tests that encompass various scenarios to ensure the ORM performs as expected. - **Conclusion**: By the end of the presentation, attendees gain a clearer understanding of both ARel and ActiveRecord, alongside the knowledge needed to build a simple ORM framework. Vipul emphasizes that while the ORM created is basic, it provides an excellent foundation for further development, potentially integrating advanced features in the future such as validations and migrations. Overall, this talk serves as a thorough introduction to the mechanics behind ORMs and the role ARel plays in simplifying SQL generation, alongside practical coding examples relevant to Ruby developers.
Suggest modifications
Cancel