RepoPilot

diesel-rs / diesel

Search diesel-rs/diesel

GitHub

Code

How diesel-rs/diesel is laid out, and where to start for common changes.

There is no import map for this report yet.

Where to start reading

  1. Repository root
  2. Repository root
  3. Likely public API
  4. Likely public API
  5. Likely start-up file
  6. Suggested starting pointAI
  7. Suggested starting pointAI
  8. Suggested starting pointAI

Find files for a task

AI

Add support for a new SQL function

  • Define function type in diesel/src/expression/functions/mod.rs or specialized module (e.g., date_and_time.rs)
  • Implement QueryFragment trait for the function to emit SQL, using diesel/src/expression/functions/helper_types.rs patterns
  • Add extension trait in diesel/src/expression_methods/ to expose function as method on column expressions
  • For database-specific implementations, add variant in backend query builders (e.g., diesel/src/mysql_like/query_builder/mod.rs)

Add a new backend database (e.g., new SQL dialect)

  • Create new backend module at diesel/src/[backend_name]/ with backend.rs defining Backend trait implementation
  • Implement Connection trait in [backend_name]/connection.rs with statement preparation and row deserialization
  • Create query builder in [backend_name]/query_builder/query_fragment_impls.rs mapping Diesel AST to dialect-specific SQL
  • Add backend feature gate to diesel/Cargo.toml and conditionally export in diesel/src/lib.rs

Add a new expression operator or type cast

  • Define operator enum in diesel/src/expression/operators.rs and implement BinOp trait
  • Add operator to diesel/src/macros/ops.rs to auto-generate trait implementations via macro expansion
  • Implement QueryFragment for operator in backend-specific query builders (diesel/src/mysql_like/query_builder/mod.rs or similar)
  • Expose operator via extension trait method in diesel/src/expression_methods/

Change the public API

Trace runtime behavior

Add or update tests

Change build or automation

RepoPilot lists up to 500 files, so a file missing here may still exist.

  • Files marked “likely” are guessed from their names.

Code quality and hotspots

Largest source files

  • Branch points62 per file on average
  • Code issues0 errors, 10 warnings
  • Largest file4,432 lines
  • Hotspot load3 high-risk files

Static checks on the 15 largest source files.

Tests, CI and tooling

  • CIGitHub Actions11 workflows
  • Tests1,381 test filesRust test · 2.6 test files per source file (file count, not coverage)
  • Dependency updatesNo config detected

Test folders: diesel_cli/tests · diesel_cli/tests/generate_migrations/add_enum · diesel_cli/tests/generate_migrations/add_enum_variant

Hotspots

Files that change often and branch heavily, highest first. Branch points count if, loop, case, catch, ternary, && and || in the file.