When it comes to data access, there are two major paradigms: Object-relational Mappers and raw SQL. Both have their pros and cons, but what if there is a happy middle ground between the two?
This talk explains how to encode Relational Algebra, the basis of SQL, into a simple domain-specific language. The resulting DSL gives us the robustness and composability of ORMs with the expressiveness and low overhead of hand-crafted SQL. As an added bonus it gives us some of the features of LINQ for free, without the need for language extensions!
Christoffer Ekeroth
I'm a senior software engineer who's passionate about efficiency and continuous improvement. Currently helping functional programming to take over the world at Functional Software.
/ ekeroth
Video sponsor – Ada Beat
https://adabeat.com
Merch
If you want to spread functional programming and support the channel, buy something from the shop:https://funcprogsweden.myspreadshop.net/
00:00 Introduction by Magnus Sedlacek
00:19 Welcome Christoffer Ekeroth
01:00 Replace Your ORM With Relational Algebra by Christoffer Ekeroth
01:16 Background
02:05 Agenda
02:51 Data Access
04:12 ORM
05:46 Raq SQL
07:18 A third option?
08:04 Basic Concept
08:46 Relational Algebra
10:19 Why Relational Algebra
11:33 Chart of the different sets
12:27 Operations Relational Algebra
14:06 Common extensions of Relational Algebra
14:58 Query DSL
15:26 Demo of generating SQL
26:56 Other implementations of Query DSL
29:18 Demo of In-memory interpreter
31:02 Conclusion
33:00 Q&A
#funcprogsweden