issue/2-database-routing #8

Merged
psycodepath merged 1 commit from issue/2-database-routing into main 2026-07-03 18:49:53 +00:00
Owner
No description provided.
feat: implement TenantContext and tenant detection via subdomain
Some checks failed
CI/CD Pipeline / test (pull_request) Failing after 2s
CI/CD Pipeline / build-and-push (pull_request) Failing after 0s
cafbb879eb
- Add TenantContext value object for representing tenant identity
- Add TenantDetectorInterface port for tenant detection abstraction
- Implement SubdomainTenantDetector adapter for extracting tenant from HTTP Host header
- Add comprehensive unit tests for tenant detection logic
- Add Behat feature tests for tenant detection scenarios

Handles subdomain extraction from localhost-style hosts (e.g., family1.localhost)
and gracefully falls back to empty tenant for requests without subdomains.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
feat: implement dynamic SQLite database routing per tenant
Some checks failed
CI/CD Pipeline / test (pull_request) Failing after 1s
CI/CD Pipeline / build-and-push (pull_request) Failing after 0s
40d2923d6d
- Add TenantContextHolder to track current tenant in request context
- Add TenantAwarePdoFactory to create tenant-specific database connections
- Register tenant detection and database routing in AppBootstrap
- Add comprehensive unit tests for database routing
- Add Behat feature tests for dynamic database isolation

Database files follow naming pattern: var/tenant_<tenant_id>.sqlite
Default tenant uses var/tenant_default.sqlite when no subdomain detected.
Database files are created automatically on first access.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
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
psycodepath/hrp!8
No description provided.