/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import React, { ChangeEvent, EventHandler } from 'react'; import cx from 'classnames'; import { t } from '@superset-ui/core'; import InfoTooltip from 'src/components/InfoTooltip'; import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox'; import Collapse from 'src/components/Collapse'; import { StyledInputContainer, StyledJsonEditor, StyledExpandableForm, } from 'src/views/CRUD/data/database/DatabaseModal/styles'; import { DatabaseObject } from '../types'; const defaultExtra = '{\n "metadata_params": {},\n "engine_params": {},' + '\n "metadata_cache_timeout": {},\n "schemas_allowed_for_csv_upload": [] \n}'; const ExtraOptions = ({ db, onInputChange, onTextChange, onEditorChange, }: { db: DatabaseObject | null; onInputChange: EventHandler>; onTextChange: EventHandler>; onEditorChange: Function; }) => { const expandableModalIsOpen = !!db?.expose_in_sqllab; const createAsOpen = !!(db?.allow_ctas || db?.allow_cvas); return (

SQL Lab

Configure how this database will function in SQL Lab.

} key="1" >
{t('CTAS & CVAS SCHEMA')}
{t( 'When allowing CREATE TABLE AS option in SQL Lab, this option ' + 'forces the table to be created in this schema.', )}

Performance

Adjust settings that will impact the performance of this database.

} key="2" >
{t('Chart cache timeout')}
{t( 'Duration (in seconds) of the caching timeout for charts of this database.' + ' A timeout of 0 indicates that the cache never expires.' + ' Note this defaults to the global timeout if undefined.', )}

Security

Add connection information for other systems.

} key="3" >
{t('Secure extra')}
onEditorChange(json, 'encrypted_extra') } width="100%" height="160px" />
{t('JSON string containing additional connection configuration.')}
{t( 'This is used to provide connection information for systems like Hive, ' + 'Presto, and BigQuery, which do not conform to the username:password syntax ' + 'normally used by SQLAlchemy.', )}
{t('Root certificate')}