Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
feat: use 'unavailable' for resources without region (#1183)
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanschaaf authored Jul 7, 2022
1 parent 2907699 commit e7dac0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion views/resources.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ select table_name from information_schema.columns where table_name like 'aws_%s'
strSQL = strSQL || format('select cq_id, cq_meta, %L as cq_table, account_id, %s as region, arn, %s as tags,
COALESCE(%s, (cq_meta->>''last_updated'')::timestamp) as fetch_date
FROM %s', tbl,
CASE WHEN EXISTS (SELECT 1 FROM information_schema.columns WHERE column_name='region' AND table_name=tbl) THEN 'region' ELSE 'NULL' END,
CASE WHEN EXISTS (SELECT 1 FROM information_schema.columns WHERE column_name='region' AND table_name=tbl) THEN 'region' ELSE E'\'unavailable\'' END,
CASE WHEN EXISTS (SELECT 1 FROM information_schema.columns WHERE column_name='tags' AND table_name=tbl) THEN 'tags' ELSE '''{}''::jsonb' END,
CASE WHEN EXISTS (SELECT 1 FROM information_schema.columns WHERE column_name='fetch_date' AND table_name=tbl) THEN 'fetch_date' ELSE 'NULL::timestamp' END,
tbl);
Expand Down

0 comments on commit e7dac0f

Please sign in to comment.