[sqllab] config item for SQLLAB_DEFAULT_DBID (#1793)

This commit is contained in:
Maxime Beauchemin
2016-12-07 21:01:02 -08:00
committed by GitHub
parent a95cd71456
commit aeda5bd260
5 changed files with 44 additions and 27 deletions

View File

@@ -101,7 +101,9 @@ class TabbedSqlEditors extends React.PureComponent {
const activeQueryEditor = this.activeQueryEditor();
const qe = {
title: `Untitled Query ${queryCount}`,
dbId: (activeQueryEditor) ? activeQueryEditor.dbId : null,
dbId: (activeQueryEditor && activeQueryEditor.dbId) ?
activeQueryEditor.dbId :
this.props.defaultDbId,
schema: (activeQueryEditor) ? activeQueryEditor.schema : null,
autorun: false,
sql: 'SELECT ...',
@@ -216,6 +218,7 @@ function mapStateToProps(state) {
tabHistory: state.tabHistory,
networkOn: state.networkOn,
tables: state.tables,
defaultDbId: state.defaultDbId,
};
}
function mapDispatchToProps(dispatch) {