Skip to content

Commit

Permalink
Add beta BigQuery support. See https://flywaydb.org/documentation/dat…
Browse files Browse the repository at this point in the history
  • Loading branch information
MikielAgutu committed Jun 1, 2021
1 parent 126c276 commit 616f90b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -21,3 +21,4 @@ target

flyway-core/SPOOLEDCONTENTS.SQL
flyway-cli-sample/jars/
out/**
5 changes: 5 additions & 0 deletions flyway-commandline/pom.xml
Expand Up @@ -37,6 +37,11 @@
<artifactId>flyway-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>flyway-community-db-support</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
Expand Down
1 change: 1 addition & 0 deletions flyway-commandline/src/main/assembly/flyway.conf
Expand Up @@ -40,6 +40,7 @@
# SQLite : jdbc:sqlite:<database>
# Sybase ASE : jdbc:jtds:sybase://<host>:<port>/<database>
# Redshift* : jdbc:redshift://<host>:<port>/<database>
# BigQuery* : jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=<project_id>;OAuthType=0;OAuthServiceAcctEmail=<service_account_name>;OAuthPvtKeyPath=<path_to_service_account>;
# flyway.url=

# Fully qualified classname of the JDBC driver (autodetected by default based on flyway.url)
Expand Down
Expand Up @@ -342,8 +342,6 @@ public void update(String sql, Object... params) throws SQLException {

protected PreparedStatement prepareStatement(String sql, Object[] params) throws SQLException {
PreparedStatement statement = connection.prepareStatement(sql);

//Spanner requires specific types for null but most others e.g. postgres don't work that way
for (int i = 0; i < params.length; i++) {
if (params[i] == null) {
statement.setNull(i + 1, nullType);
Expand Down
Expand Up @@ -20,15 +20,18 @@
import org.flywaydb.core.api.logging.Log;
import org.flywaydb.core.api.logging.LogFactory;
import org.flywaydb.core.api.resource.LoadableResource;


import org.flywaydb.core.internal.util.UrlUtils;

import java.io.*;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Paths;






public class ClassPathResource extends LoadableResource {
private static final Log LOG = LogFactory.getLog(ClassPathResource.class);
private final String fileNameWithAbsolutePath;
Expand Down
Expand Up @@ -120,6 +120,8 @@ public void execute(SqlScript sqlScript) {








Expand Down Expand Up @@ -189,6 +191,10 @@ protected void logStatementExecution(SqlStatement sqlStatement) {










Expand Down Expand Up @@ -260,7 +266,7 @@ protected void outputQueryResult(Result result) {
}

private void handleUpdateCount(long updateCount) {
LOG.debug(updateCount + (updateCount == 1 ? "row" : "rows") + "affected");
LOG.debug(updateCount + (updateCount == 1 ? " row" : " rows") + " affected");
}

protected void handleException(Results results, SqlScript sqlScript, SqlStatement sqlStatement) {
Expand Down
Binary file not shown.
3 changes: 2 additions & 1 deletion pom.xml
Expand Up @@ -482,7 +482,8 @@
<version>${version.msal4j}</version>
<optional>true</optional>
</dependency>
<!-- Temporary - overrides the transitive dependency in msal4j -->
<!-- Override the transitive dependency in msal4j to avoid an insecure version. This can be removed
when msal4j is bumped to this version of nimbus-jose-jwt or higher. -->
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
Expand Down

0 comments on commit 616f90b

Please sign in to comment.