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 TypeMethodDescriptionorg.neo4j.driver.Driver
org.neo4j.driver.Session
default org.neo4j.driver.Session
Convenience method to return an imperative session against the configured server and database.org.neo4j.driver.SessionConfig
Use this session config in your Java-based migration to make sure you use the same database as the migration tool itself.org.neo4j.driver.SessionConfig
getSessionConfig
(UnaryOperator<org.neo4j.driver.SessionConfig.Builder> configCustomizer) This method provides a callback that will be applied to theSessionConfig.Builder
just before aSessionConfig
is 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.Builder
just before aSessionConfig
is 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.
-