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

Where clause with in operator not working #242

Closed
bigdatasourav opened this issue Dec 1, 2021 · 1 comment
Closed

Where clause with in operator not working #242

bigdatasourav opened this issue Dec 1, 2021 · 1 comment

Comments

@bigdatasourav
Copy link

with in --

> select
      r.full_name as resource,
      case
        when b.allow_force_pushes_enabled = 'false' then 'ok'
        else 'alarm'
      end as status,
      r.full_name || ' default branch ' || b.name ||
        case
          when b.allow_force_pushes_enabled = 'false' then ' prevents force push.'
          when b.allow_force_pushes_enabled = 'true' then ' allows force push.'
          -- If not false or true, then null, which means no branch protection rule exists
          else ' is not protected.'
        end as reason,
      r.full_name
    from
      github_my_repository as r
      left join github_branch_protection as b on r.full_name = b.repository_full_name
    where
      visibility = 'public' and r.fork = false and b.name in ('main','master')
+----------+--------+--------+-----------+
| resource | status | reason | full_name |
+----------+--------+--------+-----------+
+----------+--------+--------+-----------+

After replacing it with or

>  select
      r.full_name as resource,
      case
        when b.allow_force_pushes_enabled = 'false' then 'ok'
        else 'alarm'
      end as status,
      r.full_name || ' default branch ' || b.name ||
        case
          when b.allow_force_pushes_enabled = 'false' then ' prevents force push.'
          when b.allow_force_pushes_enabled = 'true' then ' allows force push.'
          -- If not false or true, then null, which means no branch protection rule exists
          else ' is not protected.'
        end as reason,
      r.full_name
    from
      github_my_repository as r
      left join github_branch_protection as b on r.full_name = b.repository_full_name
    where
      visibility = 'public' and r.fork = false and (b.name = 'main' or b.name = 'master')
+---------------------------+--------+------------------------------------------------------------------+---------------------------+
| resource                  | status | reason                                                           | full_name                 |
+---------------------------+--------+------------------------------------------------------------------+---------------------------+
| bigdatasourav/turbot-test | alarm  | bigdatasourav/turbot-test default branch main allows force push. | bigdatasourav/turbot-test |
+---------------------------+--------+------------------------------------------------------------------+---------------------------+

kaidaguerre referenced this issue in turbot/steampipe-postgres-fdw Dec 1, 2021
…han optionan key columns. Closes #116. Closes #124. Closes #117
kaidaguerre referenced this issue in turbot/steampipe-postgres-fdw Dec 20, 2021
…t than than optionan key columns. Closes #116. Closes #124. Closes #117 (#125)"

This reverts commit 7fd8959.
kaidaguerre referenced this issue in turbot/steampipe-postgres-fdw Dec 21, 2021
…han optional key columns - reimplemented with improved memory usage. Closes #116. Closes #124. Closes #117 (#125)
@kaidaguerre kaidaguerre reopened this Dec 23, 2021
@kaidaguerre kaidaguerre transferred this issue from turbot/steampipe-postgres-fdw Dec 23, 2021
@kaidaguerre
Copy link
Contributor

fixed by 21dcd95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants