Skip to content

Commit

Permalink
IntelliJ DataSource interface changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-inv committed Dec 6, 2018
1 parent 1f70ae2 commit 3f7028d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import com.alivanov.intellij.plugins.liquigen.command.AuthorParametrizedDiffToChangeLogCommand;
import com.intellij.database.dataSource.DatabaseConnection;
import com.intellij.database.dataSource.DatabaseConnectionManager;
import com.intellij.database.dataSource.LocalDataSource;
import com.intellij.database.model.DasObject;
import com.intellij.database.psi.DbDataSource;
import com.intellij.database.psi.DbElement;
import com.intellij.database.psi.DbNamespaceImpl;
import com.intellij.database.util.DbImplUtil;
import com.intellij.database.util.GuardedRef;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
Expand All @@ -28,6 +28,7 @@
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -122,7 +123,7 @@ public String generateDiff(DbDataSource target, DbDataSource reference) {

private GuardedRef<DatabaseConnection> acquireConnection(DbDataSource dataSource) throws SQLException {
return DatabaseConnectionManager.getInstance()
.build(this.project, (LocalDataSource) dataSource.getDelegate()).create();
.build(this.project, Objects.requireNonNull(DbImplUtil.getMaybeLocalDataSource(dataSource))).create();
}

private Database getDatabase(GuardedRef<DatabaseConnection> connectionRef) throws DatabaseException {
Expand Down

0 comments on commit 3f7028d

Please sign in to comment.