-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
prql.scroll
77 lines (69 loc) · 2.51 KB
/
prql.scroll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import ../code/conceptPage.scroll
id prql
name PRQL
appeared 2022
creators Maximilian Roos
tags queryLanguage
website https://prql-lang.org/
latestVersion 0.11.4
standsFor Pipelined Relational Query Language
conceptDescription PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement
writtenIn rust markdown yaml toml html javascript json css csv csharp php elixir typescript jsx bourne-shell python java zig make dockerfile xml sql nix c cpp handlebars svg
compilesTo sql
clocExtensions prql
repoStats
firstCommit 2022
commits 3263
committers 78
files 816
newestCommit 2024
country South Africa and United States
originCommunity https://github.com/PRQL
reference https://news.ycombinator.com/item?id=31897430
reference https://news.ycombinator.com/item?id=30060784
example
from employees
filter country == "USA" # Each line transforms the previous result.
aggregate [ # `aggregate` reduces column to a value.
max salary,
min salary,
count, # Closing commas are allowed :)
]
example
from employees
filter start_date > @2021-01-01 # Clear date syntax.
derive [ # `derive` adds columns / variables.
gross_salary = salary + (tax ?? 0), # Terse coalesce
gross_cost = gross_salary + benefits_cost, # Variables can use other variables.
]
filter gross_cost > 0
group [title, country] ( # `group` runs a pipeline over each group.
aggregate [ # `aggregate` reduces each group to a row.
average gross_salary,
sum_gross_cost = sum gross_cost, # `=` sets a column name.
]
)
filter sum_gross_cost > 100000 # Identical syntax for SQL's `WHERE` & `HAVING`.
derive id = f"{title}_{country}" # F-strings like python.
sort [sum_gross_cost, -country] # `-country` means descending order.
take 1..20 # Range expressions (also valid here as `take 20`).
githubRepo https://github.com/prql/prql
firstCommit 2022
stars 4261
forks 71
subscribers 41
created 2022
updated 2022
description PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement
issues 83
lineCommentToken #
hasLineComments true
# A comment
hasComments true
# A comment
hasSemanticIndentation false
domainName prql-lang.org
registered 2022
awisRank
2022 7177742
semanticScholar 0