feat(resource): add database resources #674

Merged
freemo merged 1 commit from feature/m7-post-resource-db into master 2026-03-10 19:35:41 +00:00
Owner

Summary

  • Add 4 database resource types (postgres, mysql, sqlite, duckdb) with connection arguments, auth handling, and credential masking
  • Implement TransactionSandbox for transaction_rollback strategy using BEGIN/ROLLBACK/COMMIT wrappers with SQLite concrete backend
  • Wire TransactionSandbox into SandboxFactory, replacing the NotImplementedError stub
  • Register database types as built-in types in bootstrap_builtin_types()
  • Add comprehensive Behave BDD tests (35 scenarios), Robot Framework integration tests (8 test cases), and ASV benchmarks

Key Changes

File Change
src/cleveragents/resource/handlers/database.py New: DatabaseResourceHandler + 4 type defs + connection args + validation
src/cleveragents/infrastructure/sandbox/transaction_sandbox.py New: TransactionSandbox implementing Sandbox protocol
src/cleveragents/infrastructure/sandbox/factory.py Wire transaction_rollback to TransactionSandbox
src/cleveragents/application/services/resource_registry_service.py Register 4 DB types in builtin bootstrap
src/cleveragents/domain/models/core/resource_type.py Add DB names to BUILTIN_NAMES
features/database_resources.feature 35 BDD scenarios covering all functionality
robot/database_resources.robot 8 integration test cases
benchmarks/db_resource_bench.py ASV performance benchmarks

Test Results

  • lint: passed
  • typecheck: 0 errors
  • unit_tests: 9764 scenarios passed, 0 failed
  • integration_tests: 1353 tests passed, 0 failed
  • coverage: 98.4% (threshold: 97%)

ISSUES CLOSED: #342

## Summary - Add 4 database resource types (postgres, mysql, sqlite, duckdb) with connection arguments, auth handling, and credential masking - Implement `TransactionSandbox` for `transaction_rollback` strategy using `BEGIN`/`ROLLBACK`/`COMMIT` wrappers with SQLite concrete backend - Wire `TransactionSandbox` into `SandboxFactory`, replacing the `NotImplementedError` stub - Register database types as built-in types in `bootstrap_builtin_types()` - Add comprehensive Behave BDD tests (35 scenarios), Robot Framework integration tests (8 test cases), and ASV benchmarks ## Key Changes | File | Change | |------|--------| | `src/cleveragents/resource/handlers/database.py` | New: DatabaseResourceHandler + 4 type defs + connection args + validation | | `src/cleveragents/infrastructure/sandbox/transaction_sandbox.py` | New: TransactionSandbox implementing Sandbox protocol | | `src/cleveragents/infrastructure/sandbox/factory.py` | Wire transaction_rollback to TransactionSandbox | | `src/cleveragents/application/services/resource_registry_service.py` | Register 4 DB types in builtin bootstrap | | `src/cleveragents/domain/models/core/resource_type.py` | Add DB names to BUILTIN_NAMES | | `features/database_resources.feature` | 35 BDD scenarios covering all functionality | | `robot/database_resources.robot` | 8 integration test cases | | `benchmarks/db_resource_bench.py` | ASV performance benchmarks | ## Test Results - **lint**: passed - **typecheck**: 0 errors - **unit_tests**: 9764 scenarios passed, 0 failed - **integration_tests**: 1353 tests passed, 0 failed - **coverage**: 98.4% (threshold: 97%) ISSUES CLOSED: #342
freemo added this to the v3.6.0 milestone 2026-03-10 08:40:01 +00:00
freemo force-pushed feature/m7-post-resource-db from 68341c1da4
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 16s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 36s
CI / unit_tests (pull_request) Successful in 2m36s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 3m18s
CI / coverage (pull_request) Successful in 4m56s
CI / benchmark-regression (pull_request) Successful in 32m39s
to 3c02e01426
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 35s
CI / security (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 2m56s
CI / docker (pull_request) Successful in 40s
CI / integration_tests (pull_request) Successful in 3m50s
CI / coverage (pull_request) Successful in 5m2s
CI / benchmark-regression (pull_request) Successful in 32m22s
2026-03-10 17:56:27 +00:00
Compare
freemo force-pushed feature/m7-post-resource-db from 3c02e01426
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 35s
CI / security (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 2m56s
CI / docker (pull_request) Successful in 40s
CI / integration_tests (pull_request) Successful in 3m50s
CI / coverage (pull_request) Successful in 5m2s
CI / benchmark-regression (pull_request) Successful in 32m22s
to c054675167
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 18s
CI / build (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 38s
CI / security (pull_request) Successful in 40s
CI / integration_tests (pull_request) Successful in 4m5s
CI / unit_tests (pull_request) Successful in 4m56s
CI / coverage (pull_request) Successful in 5m13s
CI / docker (pull_request) Successful in 1m10s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 19s
CI / build (push) Successful in 17s
CI / security (push) Successful in 37s
CI / typecheck (push) Successful in 40s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m59s
CI / integration_tests (push) Successful in 3m24s
CI / docker (push) Successful in 40s
CI / coverage (push) Successful in 5m14s
CI / benchmark-publish (push) Successful in 17m55s
CI / benchmark-regression (pull_request) Successful in 34m15s
2026-03-10 19:29:30 +00:00
Compare
freemo scheduled this pull request to auto merge when all checks succeed 2026-03-10 19:29:48 +00:00
freemo merged commit c054675167 into master 2026-03-10 19:35:41 +00:00
freemo deleted branch feature/m7-post-resource-db 2026-03-10 19:35:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!674
No description provided.