mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
## Summary Successfully resolved the putDirectCustomAccessor assertion failure that was preventing DatabaseSync constructor instantiation. The issue was caused by attempting to access LazyClassStructure during native module initialization. ## Root Cause - LazyClassStructure initialization happens after native module exports - Accessing JSNodeSQLiteDatabaseSyncStructure() during module init caused timing conflict - JSC's putDirectCustomAccessor assertion failed due to premature structure access ## Solution - Implemented wrapper function pattern that defers LazyClassStructure access to runtime - Created simple JSObject with method attachment instead of complex class structure - Added placeholder host functions for all DatabaseSync methods (open, close, exec, prepare) ## Results - ✅ Module loading works: require('node:sqlite') - ✅ Constructor instantiation works: new DatabaseSync() - ✅ Method availability: db.open, db.close, db.exec, db.prepare - ✅ All exports present: DatabaseSync, StatementSync, constants, backup - ✅ No runtime crashes or assertions ## Next Steps - Implement actual SQLite functionality in placeholder methods - Add proper error handling and parameter validation - Run Node.js compatibility tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
878 B
878 B