How adiwidia-dev/crucible-db works
Crucible DB is a governed database-access control plane: engineers submit deployment batches or time-bounded Query Access requests, which are governed by role policy and review, then executed or exposed through a controlled native-client tunnel. The README documents the product workflow and major capabilities; sampled source and the SOURCE INDEX support selected execution and proxy links. Many feature modules are unsampled, so their internal call relationships are not asserted.
Main entry points: QueryRequestController.php Request handling · QuerySessionWorkflow.php Session workflow · ExecuteQueryRequest.php Batch execution job · ExecuteQuerySessionQuery.php Session query execution
Components 29
Request workflow
- Request workspace
resources/js/pages/query-requests - Request handling
app/Http/Controllers/QueryRequestController.php - Request policy workflow
app/Services/QueryRequestWorkflow.php - Review decisions
app/Http/Controllers/QueryReviewController.php - Redis query queue
- Batch execution job
app/Jobs/ExecuteQueryRequest.php - Preflight checks
app/Services/DeploymentPreflight.php - Database executor
app/Services/DatabaseQueryExecutor.php - Target databases
Query access
- Session workflow
app/Services/QuerySessionWorkflow.php - Session workspace
resources/js/pages/query-sessions - Session query execution
app/Jobs/ExecuteQuerySessionQuery.php - Result snapshots
app/Services/QueryResultSnapshotStore.php
Native client proxy
- Crucible CLI
native/internal/cli - Embedded gateway
native/internal/gateway/server.go - Private proxy
native/internal/proxy/server.go - SQL protocol listeners
native/internal/mysql - Tunnel bridge
native/internal/tunnel - Native access API
app/Http/Controllers/NativeProxy
Governance and operations
- Role-scoped access
app/Models/User.php - SQL policy
app/Services/SqlPolicyManager.php - Audit trail
app/Services/AuditLogger.php - Notifications
app/Services/NotificationDispatcher.php
Identity and setup
- Authentication
app/Http/Controllers/AuthProviderController.php - Initial setup
app/Http/Controllers/SetupController.php - Application database
app/Services/ApplicationDatabaseManager.php
Other components
- Engineer
- Reviewer
- Scheduler
Connections 33
- Engineer → Request workspace: submits batch
- Request workspace → Request handling: sends request
- Request handling → Request policy workflow: manages requests
app/Http/Controllers/QueryRequestController.php - Request handling → Review decisions: requests review
- Reviewer → Review decisions: reviews batch
- Request handling → Redis query queue: dispatches approved
- Review decisions → Redis query queue: dispatches approved
- Scheduler → Redis query queue: dispatches due
- Redis query queue → Batch execution job: runs job
- Batch execution job → Preflight checks: checks freshness
app/Jobs/ExecuteQueryRequest.php - Batch execution job → Database executor: executes SQL
app/Jobs/ExecuteQueryRequest.php - Database executor → Target databases: runs statements
- Batch execution job → Audit trail: records activity
app/Jobs/ExecuteQueryRequest.php - Engineer → Session workspace: requests session
- Session workspace → Session workflow: manages session
- Session workflow → Session query execution: executes query
app/Services/QuerySessionWorkflow.php - Session query execution → Database executor: runs query
- Session query execution → Result snapshots: stores results
- Scheduler → Session workflow: expires sessions
- Crucible CLI → Embedded gateway: opens tunnel
- Embedded gateway → Tunnel bridge: bridges traffic
native/internal/gateway/server.go - Private proxy → SQL protocol listeners: serves protocols
- SQL protocol listeners → Tunnel bridge: forwards statements
- Native access API → Private proxy: authorizes access
- Session workflow → Native access API: issues session access
- SQL protocol listeners → Target databases: connects privately
- Request handling → Role-scoped access: checks permissions
app/Http/Controllers/QueryRequestController.php - Batch execution job → SQL policy: evaluates policy
- Session workflow → Role-scoped access: enforces scope
app/Services/QuerySessionWorkflow.php - Session workflow → SQL policy: checks statements
- Request handling → Notifications: notifies users
- Authentication → Engineer: authenticates
- Initial setup → Application database: configures storage