Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated homebrew provider #196

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 98 additions & 5 deletions providers/src/homebrew/v00.00.00000/services/formula.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,22 @@ components:
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
fallback:
predicate: sqlDialect == "postgres"
ddl: |-
SELECT
name as formula_name,
full_name,
generated_date,
--desc as description,
homepage,
json_extract_path_text(versions, 'stable') as latest_version,
license,
deprecated,
disabled
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
vw_build_errors:
name: vw_build_errors
id: homebrew.formula.vw_build_errors
Expand All @@ -474,14 +490,37 @@ components:
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
fallback:
predicate: sqlDialect == "postgres"
ddl: |-
SELECT
name as formula_name,
json_extract_path_text(json_extract_path_text(analytics, 'build_error', '30d'), formula_name) as build_errors_30d
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
vw_usage_metrics:
name: vw_usage_metrics
id: homebrew.formula.vw_usage_metrics
config:
views:
select:
predicate: sqlDialect == "sqlite3"
ddl: "SELECT\nname as formula_name,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install.30d'), '$.' || formula_name) as installs_30d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install.90d'), '$.' || formula_name) as installs_90d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install.365d'), '$.' || formula_name) as installs_365d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install_on_request.30d'), '$.' || formula_name) as install_on_requests_30d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install_on_request.90d'), '$.' || formula_name) as install_on_requests_90d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install_on_request.365d'), '$.' || formula_name) as install_on_requests_365d\t\nFROM\nhomebrew.formula.formula\nWHERE formula_name = 'stackql'"
ddl: "SELECT\nname as formula_name,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install.30d'), '$.' || formula_name) as installs_30d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install.90d'), '$.' || formula_name) as installs_90d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install.365d'), '$.' || formula_name) as installs_365d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install_on_request.30d'), '$.' || formula_name) as install_on_requests_30d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install_on_request.90d'), '$.' || formula_name) as install_on_requests_90d,\nJSON_EXTRACT(JSON_EXTRACT(analytics, '$.install_on_request.365d'), '$.' || formula_name) as install_on_requests_365d\t\nFROM\nhomebrew.formula.formula\nWHERE formula_name IN ('stackql')"
fallback:
predicate: sqlDialect == "postgres"
ddl: |-
SELECT
name as formula_name,
json_extract_path_text(json_extract_path_text(analytics, 'install', '30d'), formula_name) as installs_30d,
json_extract_path_text(json_extract_path_text(analytics, 'install', '90d'), formula_name) as installs_90d,
json_extract_path_text(json_extract_path_text(analytics, 'install', '365d'), formula_name) as installs_365d,
json_extract_path_text(json_extract_path_text(analytics, 'install_on_request', '30d'), formula_name) as install_on_requests_30d,
json_extract_path_text(json_extract_path_text(analytics, 'install_on_request', '90d'), formula_name) as install_on_requests_90d,
json_extract_path_text(json_extract_path_text(analytics, 'install_on_request', '365d'), formula_name) as install_on_requests_365d
FROM
homebrew.formula.formula
WHERE formula_name IN ('stackql')
vw_dependencies:
name: vw_dependencies
id: homebrew.formula.vw_dependencies
Expand All @@ -501,6 +540,20 @@ components:
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
fallback:
predicate: sqlDialect == "postgres"
ddl: |-
SELECT
name as formula_name,
dependencies::json::text as dependencies,
head_dependencies::json::text as head_dependencies,
build_dependencies::json::text as build_dependencies,
test_dependencies::json::text as test_dependencies,
optional_dependencies::json::text as optional_dependencies,
recommended_dependencies::json::text as recommended_dependencies
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
vw_conflicts:
name: vw_conflicts
id: homebrew.formula.vw_conflicts
Expand All @@ -516,13 +569,22 @@ components:
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
fallback:
predicate: sqlDialect == "postgres"
ddl: |-
SELECT
name as formula_name,
conflicts_with::json::text as conflicts_with,
conflicts_with_reasons::json::text as conflicts_with_reasons
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
vw_lifecycle:
name: vw_lifecycle
id: homebrew.formula.vw_lifecycle
config:
views:
select:
predicate: sqlDialect == "sqlite3"
ddl: |-
SELECT
name as formula_name,
Expand All @@ -547,16 +609,33 @@ components:
name as formula_name,
homepage,
JSON_EXTRACT(urls, '$.stable.url') as stable_url,
JSON_EXTRACT(urls, '$.head.url') as head_url,
JSON_EXTRACT(urls, '$.stable.tag') as stable_tag,
JSON_EXTRACT(urls, '$.stable.revision') as stable_revision,
JSON_EXTRACT(urls, '$.stable.using') as stable_using,
JSON_EXTRACT(urls, '$.stable.checksum') as stable_checksum,
JSON_EXTRACT(urls, '$.head.url') as head_branch,
JSON_EXTRACT(urls, '$.head.url') as head_using
JSON_EXTRACT(urls, '$.head.url') as head_url,
JSON_EXTRACT(urls, '$.head.branch') as head_branch,
JSON_EXTRACT(urls, '$.head.using') as head_using
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
fallback:
predicate: sqlDialect == "postgres"
ddl: |-
SELECT
name as formula_name,
homepage,
json_extract_path_text(urls, 'stable', 'url') as stable_url,
json_extract_path_text(urls, 'stable', 'tag') as stable_tag,
json_extract_path_text(urls, 'stable', 'revision') as stable_revision,
json_extract_path_text(urls, 'stable', 'using') as stable_using,
json_extract_path_text(urls, 'stable', 'checksum') as stable_checksum,
json_extract_path_text(urls, 'head', 'url') as head_url,
json_extract_path_text(urls, 'head', 'branch') as head_branch,
json_extract_path_text(urls, 'head', 'using') as head_using
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
vw_versions:
name: vw_versions
id: homebrew.formula.vw_versions
Expand All @@ -576,3 +655,17 @@ components:
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'
fallback:
predicate: sqlDialect == "postgres"
ddl: |-
SELECT
name as formula_name,
json_extract_path_text(versions, 'stable') as stable_version,
json_extract_path_text(versions, 'head') as head_version,
CASE
WHEN json_extract_path_text(versions, 'bottle')::boolean THEN 'true'
ELSE 'false'
END as bottle_available
FROM
homebrew.formula.formula
WHERE formula_name = 'stackql'