morpheus4j
Version:
Morpheus is a migration tool for Neo4j. It aims to be a simple and intuitive way to migrate your database.
90 lines (89 loc) • 2.54 kB
TypeScript
import { DateTime, Duration } from 'neo4j-driver';
import { z } from 'zod';
export declare enum Neo4jScheme {
BOLT = "bolt",
BOLT_SECURE = "bolt+s",
BOLT_SECURE_SELF_SIGNED = "bolt+ssc",
NEO4J = "neo4j",
NEO4J_SECURE = "neo4j+s",
NEO4J_SECURE_SELF_SIGNED = "neo4j+ssc"
}
export declare enum TransactionMode {
/**
* Run all statements in one transaction. May need more memory, but it's generally safer. Either the migration runs as a whole or not at all.
*/
PER_MIGRATION = "PER_MIGRATION",
/**
* Runs each statement in a separate transaction. May leave your database in an inconsistent state when one statement fails.
*/
PER_STATEMENT = "PER_STATEMENT"
}
export declare const Neo4jConfigSchema: z.ZodObject<{
database: z.ZodOptional<z.ZodString>;
host: z.ZodString;
migrationsPath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
password: z.ZodString;
port: z.ZodNumber;
scheme: z.ZodNativeEnum<typeof Neo4jScheme>;
transactionMode: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof TransactionMode>>>;
username: z.ZodString;
}, "strip", z.ZodTypeAny, {
host: string;
port: number;
password: string;
scheme: Neo4jScheme;
username: string;
database?: string | undefined;
migrationsPath?: string | undefined;
transactionMode?: TransactionMode | undefined;
}, {
host: string;
port: number;
password: string;
scheme: Neo4jScheme;
username: string;
database?: string | undefined;
migrationsPath?: string | undefined;
transactionMode?: TransactionMode | undefined;
}>;
export type Neo4jConfig = z.infer<typeof Neo4jConfigSchema>;
export interface Neo4jMigrationNode {
checksum: string;
description: string;
source: string;
type: 'CYPHER';
version: string;
}
export interface MigrationOptions {
dryRun?: boolean;
transactionMode?: TransactionMode;
}
export type MigrationInfo = {
node: Neo4jMigrationNode;
relation: Neo4jMigrationRelation;
};
export type Neo4jMigrationRelation = {
at: DateTime;
in: Duration;
};
export type FileInfo = {
description: string;
fileName: string;
version: string;
};
export type InitOptions = {
force?: boolean;
};
export declare enum MigrationState {
APPLIED = "APPLIED",
PENDING = "PENDING"
}
export interface MigrationTableRow {
Description: string;
ExecutionTime: string;
InstalledOn: string;
Source: string;
State: MigrationState;
Type: string;
Version: string;
}