@webdocgroup/realm-migrations
Version:
Realm DB migration service for React Native
38 lines • 1.13 kB
TypeScript
import { Hooks } from '../HookPipelines';
import { Migration } from '../Migration';
import { Schema } from '../Schema';
export type RealmMigrationServiceConfig = {
databaseName: string;
migrations: Migration[];
hooks?: Hooks;
enabled?: boolean;
};
type MigrationResult = {
schema: Schema[];
schemaVersion: number;
};
export declare class RealmMigrationService {
private migrations;
private databaseName;
private hooks;
private enabled;
constructor({ databaseName, migrations, hooks, enabled, }: RealmMigrationServiceConfig);
private currentSchemaVersion;
private latestMigrationVersion;
private nextSchemaVersion;
private shouldRun;
/**
* Derives the schemas for a given version by combining all migrations
* up to that version.
*
* @param version The version to derive schemas for.
*
* @returns An array of schemas that represent the state of the database
* at the specified version.
*/
private derriveSchemas;
private migrationsToRun;
run(): MigrationResult;
}
export {};
//# sourceMappingURL=index.d.ts.map