-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bf1a93
commit 0406d1a
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Language design | ||
|
||
In a way PRQL is just a transpiler to SQL. This can cause its language design to | ||
gravitate toward thinking about PRQL features in terms of how they translate to | ||
SQL. | ||
|
||
``` | ||
PRQL feature -> SQL feature -> relational result | ||
``` | ||
|
||
This is flawed because: | ||
|
||
- it does not model interactions between features well, | ||
- SQL behavior can sometimes be misleading (the order of a subquery will not | ||
persist in the parent query) or even differs between dialects (set | ||
operations). | ||
|
||
Instead, we should think of PRQL features in terms of how they affect PRQL | ||
expressions, which in most cases means how they affect relations. | ||
|
||
``` | ||
PRQL feature -> relation | ||
| | ||
v | ||
PRQL feature -> relation | ||
| | ||
v | ||
PRQL feature -> relation | ||
| | ||
v | ||
relational result | ||
``` | ||
|
||
Thinking about SQL comes in only at the last step when relation (or rather | ||
relational expression) is translated to an SQL expression. |