Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Conditionally load JDBC dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
szydan committed Apr 27, 2017
1 parent a09d6e2 commit 5665394
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/kibi_plugins/kibi_core/lib/query_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import RestQuery from './queries/rest_query';
import ErrorQuery from './queries/error_query';
import InactivatedQuery from './queries/inactivated_query';
import MissingSelectedDocumentQuery from './queries/missing_selected_document_query';
import JDBC from 'jdbc';
import jinst from 'jdbc/lib/jinst';
import JdbcQuery from './queries/jdbc_query';
import JdbcHelper from './jdbc_helper';
let JdbcQuery;

function QueryEngine(server) {
this.server = server;
Expand Down Expand Up @@ -353,6 +350,10 @@ QueryEngine.prototype._loadQueries = function () {

QueryEngine.prototype.setupJDBC = function () {
if (this.config.get('kibi_core.load_jdbc') === true) {
const JDBC = require('jdbc');
const jinst = require('jdbc/lib/jinst');
JdbcQuery = require('./queries/jdbc_query');
const JdbcHelper = require('./jdbc_helper');
const jdbcHelper = new JdbcHelper(this.server);

return jdbcHelper.prepareJdbcPaths().then(function (paths) {
Expand Down

0 comments on commit 5665394

Please sign in to comment.