mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 09:28:51 +00:00
Add option to enable Auto Get Schema
This commit is contained in:
parent
f07ed1df31
commit
a98ead9030
@ -48,9 +48,14 @@ class TreasureData(BaseQueryRunner):
|
|||||||
'type': {
|
'type': {
|
||||||
'type': 'string'
|
'type': 'string'
|
||||||
},
|
},
|
||||||
"db": {
|
'db': {
|
||||||
"type": "string",
|
'type': 'string',
|
||||||
"title": "Database Name"
|
'title': 'Database Name'
|
||||||
|
},
|
||||||
|
'getschema': {
|
||||||
|
'type': 'boolean',
|
||||||
|
'title': 'Auto Get Schema',
|
||||||
|
'Default': True
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'required': ['apikey','db']
|
'required': ['apikey','db']
|
||||||
@ -71,8 +76,9 @@ class TreasureData(BaseQueryRunner):
|
|||||||
def __init__(self, configuration):
|
def __init__(self, configuration):
|
||||||
super(TreasureData, self).__init__(configuration)
|
super(TreasureData, self).__init__(configuration)
|
||||||
|
|
||||||
def get_schema(self):
|
def get_schema(self, get_stats=False):
|
||||||
schema = {}
|
schema = {}
|
||||||
|
if self.configuration.get('getschema') == True:
|
||||||
try:
|
try:
|
||||||
with tdclient.Client(self.configuration.get('apikey')) as client:
|
with tdclient.Client(self.configuration.get('apikey')) as client:
|
||||||
for table in client.tables(self.configuration.get('db')):
|
for table in client.tables(self.configuration.get('db')):
|
||||||
|
Loading…
Reference in New Issue
Block a user