@robojs/flashcore-extras
Advanced Flashcore features — adapter wrappers, migrations, integrity checks, transactions, and CLI commands.
Extend Flashcore with production-grade features. This plugin registers extension implementations for migration, integrity, transaction, and WAL subsystems that are defined as interfaces in the core framework.
Features
Adapter Wrappers
Add caching, compression, encryption, and resilience to any adapter
Migrations
Versioned schema migrations with auto-repair
Transactions
ACID-like serial and optimistic concurrency modes
Integrity
Verify and repair indexes, filters, and catalogs
Write-Ahead Log
Crash safety with automatic recovery
CLI Commands
/db terminal commands for database management
Installation
npx robo add @robojs/flashcore-extras@nextHow It Works
When your Robo starts, the plugin's start hook registers implementations for Flashcore's extension points:
- Migration — schema metadata, history tracking, diff analysis, and the migration runner
- Integrity — checker, repair engine, and catalog rebuild
- Transaction — context management, serial queue, and optimistic locking
- WAL — write-ahead log manager, recovery, and delta builders
These extensions are only loaded when @robojs/flashcore-extras is installed. The core Flashcore framework defines the interfaces but delegates the implementations to this plugin.
Quick Example
Add caching and compression to any adapter:
import { AdapterBuilder } from '@robojs/flashcore-extras/adapters'
import { FileAdapter } from 'robo.js/flashcore'
const adapter = new AdapterBuilder(new FileAdapter())
.withCompression({ threshold: 512 })
.withCache({ maxSize: 1000 })
.build()
export default {
flashcore: { adapter }
}import { AdapterBuilder } from '@robojs/flashcore-extras/adapters'
import { FileAdapter } from 'robo.js/flashcore'
const adapter = new AdapterBuilder(new FileAdapter())
.withCompression({ threshold: 512 })
.withCache({ maxSize: 1000 })
.build()
export default {
flashcore: { adapter }
}Next Steps
Adapter Wrappers
Add caching, compression, encryption, and resilience to any adapter.
Migrations
Manage schema changes with versioned migrations.
Transactions
ACID-like transactions with serial and optimistic modes.
Integrity & Repair
Verify and repair database integrity.
Write-Ahead Log
Crash safety with automatic recovery.
CLI Commands
Terminal commands for database management.
