[SQL Lab] Adding DB options for SQL LAb (#1054)

* [SQL Lab] Adding DB options for SQL LAb

each db can be exposed or not in SQL Lab
CTAS is an option
target_schema placeholder (not hooked yet, but would force the CTAS to
target a specific schema)

* Addressing comments
This commit is contained in:
Maxime Beauchemin
2016-09-01 14:21:46 -07:00
committed by GitHub
parent 1667d15f31
commit 4b77710016
16 changed files with 170 additions and 66 deletions

View File

@@ -48,6 +48,8 @@ class QueryEditors extends React.Component {
render() {
const editors = this.props.queryEditors.map((qe, i) => {
let latestQuery = this.props.queries[qe.latestQueryId];
const database = this.props.databases[qe.dbId];
const state = (latestQuery) ? latestQuery.state : '';
const tabTitle = (
<div>
@@ -76,6 +78,7 @@ class QueryEditors extends React.Component {
<SqlEditor
queryEditor={qe}
latestQuery={latestQuery}
database={database}
/>
</div>
</div>
@@ -95,6 +98,7 @@ class QueryEditors extends React.Component {
}
QueryEditors.propTypes = {
actions: React.PropTypes.object,
databases: React.PropTypes.object,
queries: React.PropTypes.object,
queryEditors: React.PropTypes.array,
tabHistory: React.PropTypes.array,
@@ -106,6 +110,7 @@ QueryEditors.defaultProps = {
function mapStateToProps(state) {
return {
databases: state.databases,
queryEditors: state.queryEditors,
queries: state.queries,
tabHistory: state.tabHistory,