You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// builtinAliases ship with the binary so `lrc query <name>` works even before
20
+
// the installer writes ~/.lrc/queries.toml. User-defined aliases override these.
21
+
funcbuiltinAliases() map[string]string {
22
+
returnmap[string]string{
23
+
"stats": "SELECT action AS Action, COUNT(*) AS Commits, ROUND(AVG(iterations),1) AS AvgIter, ROUND(AVG(coverage),1) AS AvgCoveragePct FROM review_log GROUP BY action ORDER BY Commits DESC",
24
+
"by-author": "SELECT author AS Author, COUNT(*) AS Commits, SUM(action = 'reviewed') AS Reviewed FROM review_log GROUP BY author ORDER BY Commits DESC",
25
+
"recent": "SELECT short_hash AS Hash, date AS Date, action AS Action, subject AS Subject FROM review_log ORDER BY date DESC LIMIT 20",
26
+
}
27
+
}
28
+
29
+
// AliasInfo describes one alias and where it came from.
30
+
typeAliasInfostruct {
31
+
Namestring
32
+
SQLstring
33
+
Sourcestring// "built-in" or "user"
34
+
}
35
+
36
+
// queriesPath returns ~/.lrc/queries.toml.
37
+
funcqueriesPath() (string, error) {
38
+
dir, err:=configpath.ResolveLRCDataDir()
39
+
iferr!=nil {
40
+
return"", err
41
+
}
42
+
returnfilepath.Join(dir, "queries.toml"), nil
43
+
}
44
+
45
+
// loadUserAliases reads ~/.lrc/queries.toml ([queries] table). Missing file is
0 commit comments