Python CLI utility and library for manipulating SQLite databases
This report summarizes scanner evidence for simonw/sqlite-utils, a Python project with 2,179 GitHub stars. SynthScan examined 28,993 lines of code across 84 source files, recording 606 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 18.1 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 578 finding(s).
Are imports declared and package/API names verified? 14 finding(s).
Are wrappers, guards, and repeated structures necessary? 552 finding(s).
Which changes need focused human review? 606 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 606 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 126 | def _column_definition_with_comments( | STRING |
| LOW | sqlite_utils/db.py | 359 | def _iter_complete_sql_statements(sql: str) -> Generator[str, None, None]: | STRING |
| LOW | sqlite_utils/db.py | 1230 | def _ensure_no_open_transaction(self, operation: str) -> None: | STRING |
| LOW | sqlite_utils/db.py | 1387 | def _resolve_foreign_key_casing( | STRING |
| LOW | sqlite_utils/db.py | 4305 | def build_insert_queries_and_params( | STRING |
| LOW | sqlite_utils/create_table_parser.py | 832 | def check_references_identifier(expression: str, identifier: str) -> bool: | CODE |
| LOW | sqlite_utils/cli.py | 1061 | def insert_upsert_implementation( | STRING |
| LOW | sqlite_utils/cli.py | 2944 | def yield_paths_and_relative_paths(): | STRING |
| LOW | sqlite_utils/cli.py | 3469 | def _compatible_migration_set(obj): | CODE |
| LOW | sqlite_utils/cli.py | 3508 | def _stop_before_for_migration_set(stop_before, migration_set_name): | CODE |
| LOW | sqlite_utils/cli.py | 3779 | def _maybe_register_functions(db, functions_list): | CODE |
| LOW | sqlite_utils/utils.py | 87 | def maximize_csv_field_size_limit() -> None: | CODE |
| LOW | tests/test_conversions.py | 7 | def test_insert_all_conversion(fresh_db): | CODE |
| LOW | tests/test_conversions.py | 23 | def test_upsert_all_conversion(fresh_db): | CODE |
| LOW | tests/test_conversions.py | 38 | def test_table_constructor_conversion(fresh_db): | CODE |
| LOW | tests/test_default_value.py | 41 | def test_insert_empty_record_uses_default_values(fresh_db): | CODE |
| LOW | tests/test_enable_counts.py | 7 | def test_enable_counts_specific_table(fresh_db): | CODE |
| LOW | tests/test_enable_counts.py | 59 | def test_enable_counts_all_tables(fresh_db): | CODE |
| LOW | tests/test_enable_counts.py | 128 | def test_uses_counts_after_enable_counts(counts_db_path): | CODE |
| LOW | tests/test_utils.py | 58 | def test_maximize_csv_field_size_limit(): | CODE |
| LOW | tests/test_transform.py | 124 | def test_transform_sql_table_with_primary_key( | CODE |
| LOW | tests/test_transform.py | 205 | def test_transform_sql_table_with_no_primary_key( | CODE |
| LOW | tests/test_transform.py | 232 | def test_transform_sql_with_no_primary_key_to_primary_key_of_id(fresh_db): | CODE |
| LOW | tests/test_transform.py | 257 | def test_transform_preserves_keyword_literal_defaults(fresh_db): | CODE |
| LOW | tests/test_transform.py | 301 | def test_transform_remove_a_not_null(fresh_db): | CODE |
| LOW | tests/test_transform.py | 312 | def test_transform_add_not_null_with_rename(fresh_db, not_null): | CODE |
| LOW | tests/test_transform.py | 332 | def test_transform_defaults_and_rename_column(fresh_db): | CODE |
| LOW | tests/test_transform.py | 365 | def test_transform_foreign_keys_persist(authors_db): | CODE |
| LOW | tests/test_transform.py | 380 | def test_transform_foreign_keys_survive_renamed_column( | CODE |
| LOW | tests/test_transform.py | 396 | def _add_country_city_continent(db): | CODE |
| LOW | tests/test_transform.py | 412 | def test_transform_drop_foreign_keys(fresh_db, use_pragma_foreign_keys): | CODE |
| LOW | tests/test_transform.py | 445 | def test_transform_verify_foreign_keys(fresh_db): | CODE |
| LOW | tests/test_transform.py | 464 | def test_transform_on_delete_cascade_does_not_delete_records( | CODE |
| LOW | tests/test_transform.py | 503 | def test_transform_in_transaction_refuses_destructive_on_delete(fresh_db, on_delete): | STRING |
| LOW | tests/test_transform.py | 535 | def test_transform_in_transaction_refuses_self_referential_cascade(fresh_db): | STRING |
| LOW | tests/test_transform.py | 558 | def test_transform_in_transaction_allowed_with_no_action_foreign_key(fresh_db): | STRING |
| LOW | tests/test_transform.py | 585 | def test_transform_in_transaction_allowed_for_child_table(fresh_db): | STRING |
| LOW | tests/test_transform.py | 608 | def test_transform_in_transaction_allowed_with_foreign_keys_off(fresh_db): | STRING |
| LOW | tests/test_transform.py | 630 | def test_transform_add_foreign_keys_from_scratch(fresh_db): | STRING |
| LOW | tests/test_transform.py | 676 | def test_transform_add_foreign_keys_from_partial(fresh_db, add_foreign_keys): | STRING |
| LOW | tests/test_transform.py | 716 | def test_transform_replace_foreign_keys(fresh_db, foreign_keys): | STRING |
| LOW | tests/test_transform.py | 737 | def test_transform_preserves_rowids(fresh_db, table_type): | STRING |
| LOW | tests/test_transform.py | 787 | def test_transform_to_strict_with_invalid_data(fresh_db): | STRING |
| LOW | tests/test_transform.py | 802 | def test_transform_strict_updates_default(fresh_db): | STRING |
| LOW | tests/test_transform.py | 816 | def test_transform_to_strict_not_supported(fresh_db, method_name): | STRING |
| LOW | tests/test_transform.py | 827 | def test_transform_preserves_any_column_in_strict_table(fresh_db): | STRING |
| LOW | tests/test_transform.py | 858 | def test_transform_any_column_from_strict_to_non_strict(fresh_db): | STRING |
| LOW | tests/test_transform.py | 918 | def test_transform_retains_indexes_with_foreign_keys(fresh_db): | STRING |
| LOW | tests/test_transform.py | 946 | def test_transform_with_indexes_errors(fresh_db): | STRING |
| LOW | tests/test_transform.py | 967 | def test_transform_rename_column_with_index(fresh_db, table_name, index_name): | STRING |
| LOW | tests/test_transform.py | 988 | def test_transform_recreates_renamed_index_from_metadata(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1018 | def test_transform_rename_complex_index_errors(fresh_db, index_sql): | STRING |
| LOW | tests/test_transform.py | 1030 | def test_transform_with_unique_constraint_implicit_index(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1049 | def test_transform_preserves_composite_unique_constraint(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1076 | def test_transform_preserves_column_unique_collation(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1093 | def test_transform_drops_entire_composite_unique_constraint(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1110 | def test_transform_preserves_autoincrement_and_sequence(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1138 | def test_transform_empty_string_to_null_for_numeric_types( | STRING |
| LOW | tests/test_transform.py | 1158 | def test_transform_preserves_view(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1182 | def test_transform_variants_preserve_view(fresh_db, transform_params): | STRING |
| 464 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | sqlite_utils/db.py | 426 | except AttributeError: | CODE |
| HIGH | sqlite_utils/db.py | 5545 | except ValueError: | CODE |
| HIGH | sqlite_utils/db.py | 836 | except sqlite3.NotSupportedError: | CODE |
| HIGH | sqlite_utils/cli.py | 75 | except sqlite3.Error: | CODE |
| HIGH | sqlite_utils/utils.py | 540 | except (AttributeError, SyntaxError, NameError, KeyError, TypeError): | CODE |
| HIGH | sqlite_utils/utils.py | 549 | except Exception: # noqa: BLE001, S110 | CODE |
| HIGH | tests/conftest.py | 59 | except sqlite3.Error: | CODE |
| HIGH | tests/test_rows.py | 137 | except sqlite3.OperationalError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 508 | CODE | |
| LOW | sqlite_utils/db.py | 569 | CODE | |
| LOW | sqlite_utils/db.py | 1290 | CODE | |
| LOW | sqlite_utils/db.py | 1429 | CODE | |
| LOW | sqlite_utils/db.py | 1849 | CODE | |
| LOW | sqlite_utils/db.py | 2643 | CODE | |
| LOW | sqlite_utils/db.py | 2773 | CODE | |
| LOW | sqlite_utils/db.py | 3256 | CODE | |
| LOW | sqlite_utils/db.py | 3389 | CODE | |
| LOW | sqlite_utils/db.py | 4255 | CODE | |
| LOW | sqlite_utils/db.py | 4305 | CODE | |
| LOW | sqlite_utils/db.py | 4520 | CODE | |
| LOW | sqlite_utils/db.py | 4673 | CODE | |
| LOW | sqlite_utils/db.py | 5299 | CODE | |
| LOW | sqlite_utils/db.py | 2933 | CODE | |
| LOW | sqlite_utils/create_table_parser.py | 233 | CODE | |
| LOW | sqlite_utils/create_table_parser.py | 308 | CODE | |
| LOW | sqlite_utils/create_table_parser.py | 322 | CODE | |
| LOW | sqlite_utils/cli.py | 1061 | CODE | |
| LOW | sqlite_utils/cli.py | 2105 | CODE | |
| LOW | sqlite_utils/cli.py | 2263 | CODE | |
| LOW | sqlite_utils/cli.py | 2906 | CODE | |
| LOW | sqlite_utils/cli.py | 3742 | CODE | |
| LOW | sqlite_utils/cli.py | 2944 | CODE | |
| LOW | sqlite_utils/utils.py | 140 | CODE | |
| LOW | sqlite_utils/utils.py | 263 | CODE | |
| LOW | sqlite_utils/utils.py | 288 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | sqlite_utils/db.py | 1082 | # default into a string ('TRUE' instead of 1, 'NULL' instead of null). | STRING |
| HIGH | sqlite_utils/db.py | 5353 | # Optimization - if all rows are null, don't run this query | STRING |
| HIGH | tests/test_extracts.py | 71 | # Null values should stay null, not be extracted into the lookup table | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | sqlite_utils/db.py | 546 | # Create an in-memory database: | COMMENT |
| MEDIUM | sqlite_utils/db.py | 2201 | # This method is defined on Queryable so it serves views too, which | STRING |
| MEDIUM | tests/test_transform.py | 1032 | # Create a table with a UNIQUE constraint on 'name', which creates an implicit index | STRING |
| MEDIUM | tests/test_cli.py | 916 | # Create a temporary file with function definitions | STRING |
| MEDIUM | tests/test_m2m.py | 164 | # Create a candidate | COMMENT |
| MEDIUM | docs/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/__init__.py | 1 | CODE | |
| LOW | sqlite_utils/__init__.py | 2 | CODE | |
| LOW | sqlite_utils/__init__.py | 2 | CODE | |
| LOW | sqlite_utils/__init__.py | 3 | CODE | |
| LOW | sqlite_utils/__init__.py | 4 | CODE | |
| LOW | sqlite_utils/__init__.py | 4 | CODE | |
| LOW | sqlite_utils/recipes.py | 1 | CODE | |
| LOW | sqlite_utils/migrations.py | 7 | CODE | |
| LOW | sqlite_utils/migrations.py | 7 | CODE | |
| LOW | tests/test_register_function.py | 2 | CODE | |
| LOW | tests/test_register_function.py | 3 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 569 | CODE | |
| LOW | sqlite_utils/db.py | 1429 | CODE | |
| LOW | sqlite_utils/db.py | 1700 | CODE | |
| LOW | sqlite_utils/db.py | 2285 | CODE | |
| LOW | sqlite_utils/db.py | 2540 | CODE | |
| LOW | sqlite_utils/db.py | 2643 | CODE | |
| LOW | sqlite_utils/db.py | 2773 | CODE | |
| LOW | sqlite_utils/db.py | 4018 | CODE | |
| LOW | sqlite_utils/db.py | 4604 | CODE | |
| LOW | sqlite_utils/db.py | 4673 | CODE | |
| LOW | sqlite_utils/db.py | 5031 | CODE | |
| LOW | sqlite_utils/db.py | 5069 | CODE | |
| LOW | sqlite_utils/db.py | 5117 | CODE | |
| LOW | sqlite_utils/cli.py | 1061 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 968 | except Exception: | STRING |
| LOW | sqlite_utils/cli.py | 1148 | except Exception as e: | STRING |
| LOW | sqlite_utils/cli.py | 3320 | except Exception as ex: # noqa: BLE001 | STRING |
| MEDIUM | sqlite_utils/cli.py | 3317 | def wrapped_fn(value): | CODE |
| LOW | sqlite_utils/utils.py | 549 | except Exception: # noqa: BLE001, S110 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 4784 | # Check if this is list mode or dict mode | STRING |
| LOW | sqlite_utils/cli.py | 3760 | # Check if this is a file path | COMMENT |
| LOW | sqlite_utils/utils.py | 543 | # Check if code is a direct callable reference | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 1 | import inspect | COMMENT |
| LOW | docs/conf.py | 181 | # | COMMENT |
| LOW | .github/workflows/codeql-analysis.yml | 41 | # If you wish to specify custom queries, you can do so here or in a config file. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/__init__.py | 6 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 5369 | # No need to run the query if it will just return the results in reverse order | STRING |