Skip to content

Commit

Permalink
show view
Browse files Browse the repository at this point in the history
  • Loading branch information
StpMax committed Feb 1, 2022
1 parent 65249e9 commit 0cc88a1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion mindsdb/api/mysql/mysql_proxy/mysql_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,24 @@ def query_answer(self, sql):
session=self.session
)
self.answer_select(query)
elif sql_category == 'views':
schema = 'views'
new_statement = Select(
targets=[Identifier(parts=['table_name'], alias=Identifier('View'))],
from_table=Identifier(parts=['information_schema', 'TABLES']),
where=BinaryOperation('and', args=[
BinaryOperation('=', args=[Identifier('table_schema'), Constant(schema)]),
BinaryOperation('like', args=[Identifier('table_type'), Constant('BASE TABLE')])
])
)

query = SQLQuery(
str(new_statement),
session=self.session
)
self.answer_select(query)
return
if sql_category == 'plugins':
elif sql_category == 'plugins':
if expression is not None:
raise Exception("'SHOW PLUGINS' query should be used without filters")
new_statement = Select(
Expand Down

0 comments on commit 0cc88a1

Please sign in to comment.