Skip to content
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
5 changes: 3 additions & 2 deletions dblinter/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from dblinter.database_connection import DatabaseConnection
from dblinter.function_library import FunctionLibrary
from dblinter.sarif_document import SarifDocument
from dblinter.function_library import EXCLUDED_SCHEMAS_STR

DEFAULT_CONFIG_FILE_NAME = "default_config.yaml"
PATH = "dblinter"
Expand Down Expand Up @@ -98,7 +99,7 @@ def perform_schema_check(function_library, db, config_file, sarif_document, sche
)
qry = f"""SELECT schema_name
FROM information_schema.schemata pt
WHERE schema_name NOT IN ('pg_toast', 'pg_catalog', 'information_schema','public')
WHERE schema_name NOT IN ('{EXCLUDED_SCHEMAS_STR}')
AND (schema_name = '{schema}' or '{schema}'='')
AND schema_name not in ('aiven_extras')
"""
Expand Down Expand Up @@ -160,7 +161,7 @@ def perform_table_check(
+ "]"
)
qry = f"""SELECT schemaname, tablename
FROM pg_catalog.pg_tables pt WHERE schemaname NOT IN ('pg_toast', 'pg_catalog', 'information_schema')
FROM pg_catalog.pg_tables pt WHERE schemaname NOT IN ('{EXCLUDED_SCHEMAS_STR}')
AND (schemaname = '{schema}' or '{schema}'='')
AND ((tablename ilike '{include}' or '{include}'='') AND (tablename not ilike '{exclude}' or '{exclude}'=''))
AND (tablename not in ('schema_protection'))"""
Expand Down