Package ac.simons.neo4j.migrations.core
Interface MigrationContext
public interface MigrationContext
Parameter object / context for migrations to be applied.
- Since:
- 0.0.2
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionThe details will give detailed information about the user being connected, server address and which databases - if available - are being migrated and which are used to store the schema.org.neo4j.driver.Driverorg.neo4j.driver.Sessiondefault org.neo4j.driver.SessionConvenience method to return an imperative session against the configured server and database.org.neo4j.driver.SessionConfigUse this session config in your Java-based migration to make sure you use the same database as the migration tool itself.org.neo4j.driver.SessionConfiggetSessionConfig(UnaryOperator<org.neo4j.driver.SessionConfig.Builder> configCustomizer) This method provides a callback that will be applied to theSessionConfig.Builderjust before aSessionConfigis created.
-
Method Details
-
getConfig
MigrationsConfig getConfig()- Returns:
- The configuration of this migration instance.
-
getDriver
org.neo4j.driver.Driver getDriver()- Returns:
- The driver to be used inside migrations.
-
getSessionConfig
org.neo4j.driver.SessionConfig getSessionConfig()Use this session config in your Java-based migration to make sure you use the same database as the migration tool itself.- Returns:
- A correctly configured write access session config.
-
getSessionConfig
org.neo4j.driver.SessionConfig getSessionConfig(UnaryOperator<org.neo4j.driver.SessionConfig.Builder> configCustomizer) This method provides a callback that will be applied to theSessionConfig.Builderjust before aSessionConfigis created.- Parameters:
configCustomizer- Customization callback for the builder.- Returns:
- The final session config.
- Since:
- 1.1.0
-
getSession
default org.neo4j.driver.Session getSession()Convenience method to return an imperative session against the configured server and database.- Returns:
- A session configured to use the migration context's database name.
-
getSchemaSession
org.neo4j.driver.Session getSchemaSession()- Returns:
- A session accessing the configured schema database if any or the default database.
-
getConnectionDetails
ConnectionDetails getConnectionDetails()The details will give detailed information about the user being connected, server address and which databases - if available - are being migrated and which are used to store the schema.- Returns:
- Details about the connection being used within the context of migrations.
- Since:
- 1.4.0
-