Skip to content

Commit

Permalink
FIR-31506 avoid checking that DB exist for local DB (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexradzin authored Mar 21, 2024
1 parent c48bc46 commit 7b91b3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.firebolt.jdbc.service.FireboltEngineVersion2Service;
import com.firebolt.jdbc.service.FireboltGatewayUrlService;
import com.firebolt.jdbc.service.FireboltStatementService;
import com.firebolt.jdbc.util.PropertyUtil;
import lombok.NonNull;
import okhttp3.OkHttpClient;

Expand Down Expand Up @@ -90,7 +91,7 @@ private FireboltProperties getSessionPropertiesForNonSystemEngine() throws SQLEx

@Override
protected void assertDatabaseExisting(String database) throws SQLException {
if (database != null && !getFireboltEngineService().doesDatabaseExist(database)) {
if (database != null && !PropertyUtil.isLocalDb(loginProperties) && !getFireboltEngineService().doesDatabaseExist(database)) {
throw new FireboltException(format("Database %s does not exist", database), RESOURCE_NOT_FOUND);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ void getMetadata(String testName, String engineParameter, boolean readOnly) thro
}
}

@Test
void shouldNotFetchTokenNorEngineHostForLocalFirebolt() throws SQLException {
super.shouldNotFetchTokenNorEngineHostForLocalFirebolt();
verifyNoInteractions(fireboltEngineService);
}

protected FireboltConnection createConnection(String url, Properties props) throws SQLException {
return new FireboltConnectionServiceSecret(url, props, fireboltAuthenticationService, fireboltGatewayUrlService, fireboltStatementService, fireboltEngineService, fireboltAccountIdService);
}
Expand Down

0 comments on commit 7b91b3f

Please sign in to comment.