-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add availableFounders to getMetric's metadata
- Loading branch information
1 parent
a261c27
commit 231ee9d
Showing
4 changed files
with
104 additions
and
1 deletion.
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,18 @@ | ||
defmodule Sanbase.Clickhouse.Founders do | ||
def get_founders() do | ||
query = get_founders_query() | ||
|
||
Sanbase.ClickhouseRepo.query_transform(query, fn [name, slug] -> | ||
%{name: name, slug: slug} | ||
end) | ||
end | ||
|
||
defp get_founders_query() do | ||
sql = """ | ||
SELECT name, slug | ||
FROM founder_metadata | ||
""" | ||
|
||
Sanbase.Clickhouse.Query.new(sql, %{}) | ||
end | ||
end |
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
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
55 changes: 54 additions & 1 deletion
55
test/sanbase_web/graphql/metric/api_metric_metadata_test.exs
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