UNPKG

@deepbrainspace/nx-surrealdb

Version:

NX plugin for SurrealDB migrations with modular architecture

38 lines (37 loc) 1.5 kB
export interface MigrationFile { number: string; name: string; direction: 'up' | 'down'; filename: string; filePath: string; moduleId: string; content: string; checksum: string; } export interface MigrationContext { defaultNamespace?: string; defaultDatabase?: string; useTransactions?: boolean; } export declare class MigrationFileProcessor { private static readonly MIGRATION_PATTERN; private static readonly SUBDIR_PATTERN; private static readonly NAMESPACE_OPERATIONS; private static readonly DATABASE_OPERATIONS; private static readonly DDL_OPERATIONS; private static readonly TRANSACTION_BEGIN; private static readonly TRANSACTION_COMMIT; static findMatchingSubdirectory(basePath: string, pattern: string): Promise<string | null>; static discoverModules(basePath: string): Promise<Array<{ moduleId: string; modulePath: string; }>>; static getNextMigrationNumber(modulePath: string): Promise<string>; static generateModuleId(name: string, existingModules: Array<{ moduleId: string; }>): string; static parseMigrationFile(filename: string, basePath?: string, moduleId?: string): MigrationFile | null; static matchesMigrationPattern(filename: string, pattern: string): boolean; static filterMigrationFiles(files: string[], filePattern?: string, direction?: 'up' | 'down'): string[]; static processContent(content: string, context: MigrationContext): string; }