Add UnderlyingDB() method for extension database access
Implements database platform layer for extensions like VC to create their own tables in the same SQLite database. Changes: - Add UnderlyingDB() *sql.DB to Storage interface - Implement in SQLiteStorage to expose underlying connection - Add comprehensive test suite (5 tests, -race clean) - Tests cover: basic access, extension tables, concurrency, lifecycle safety, and transaction behavior This allows VC to host its executor_instances and other tables alongside beads core tables with proper FK enforcement. Related issues: bd-57, bd-64, bd-65, bd-66 Amp-Thread-ID: https://ampcode.com/threads/T-a6715beb-fe92-4dee-b931-3c9327124875 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -1899,3 +1899,9 @@ func (s *SQLiteStorage) Close() error {
|
||||
func (s *SQLiteStorage) Path() string {
|
||||
return s.dbPath
|
||||
}
|
||||
|
||||
// UnderlyingDB returns the underlying *sql.DB connection
|
||||
// This allows extensions (like VC) to create their own tables in the same database
|
||||
func (s *SQLiteStorage) UnderlyingDB() *sql.DB {
|
||||
return s.db
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user