LogoRobo.js

@robojs/flashcore-extras

Advanced Flashcore features — adapter wrappers, migrations, integrity checks, transactions, and CLI commands.

Install @robojs/flashcore-extras with:

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@next

How 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:

config/robo.mjs
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 }
}
config/robo.mjs
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

On this page