Command-line interface tool for MikroORM TypeScript ORM providing database management, migrations, schema operations, and entity generation
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
MikroORM CLI cache management commands for handling metadata cache operations. The metadata cache improves startup performance by caching entity metadata discovery results.
Clears the existing metadata cache. Useful when metadata has changed or cache corruption is suspected.
/**
* Clear metadata cache command
*/
command: "cache:clear"
// No additional options beyond global optionsUsage Examples:
# Clear cache with default configuration
mikro-orm cache:clear
# Clear cache with specific config file
mikro-orm cache:clear --config ./custom-config.js
# Clear cache for specific context
mikro-orm cache:clear --context productionGenerates metadata cache for improved application startup performance. Supports both development and production cache formats.
/**
* Generate metadata cache command
*/
command: "cache:generate"
interface CacheGenerateOptions extends BaseArgs {
ts?: boolean; // Use ts-node to generate '.ts' cache
tsNode?: boolean; // Alias for ts
combined?: string; // Generate production cache into single JSON file
c?: string; // Alias for combined
}Usage Examples:
# Generate standard cache
mikro-orm cache:generate
# Generate TypeScript cache for development
mikro-orm cache:generate --ts-node
# Generate production cache into single file
mikro-orm cache:generate --combined
# Generate cache with custom config
mikro-orm cache:generate --config ./orm.config.js --combinedAll cache commands support:
--config / -c: Path to ORM configuration file(s)--contextName / --context: Configuration context name--ts-node / --ts: Generate TypeScript-compatible cache (for development)--combined / -c: Generate production cache into single JSON file that can be used with GeneratedCacheAdapter--ts-node, TypeScript compilation issues will prevent cache generationCache commands work with these MikroORM configuration options:
interface CacheConfiguration {
metadataCache: {
enabled: boolean; // Enable/disable cache
adapter: CacheAdapter; // Cache adapter instance
options?: {
combined?: string; // Path for combined cache file
};
};
}