|
@@ -174,6 +174,23 @@ class OptimizerApi(object):
|
|
|
raise PopupException(e, title=_('Error while accessing Optimizer'))
|
|
raise PopupException(e, title=_('Error while accessing Optimizer'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ def query_compatibility(self, source_platform, target_platform, query, token=None, email=None):
|
|
|
|
|
+ if token is None:
|
|
|
|
|
+ token = self._authenticate()
|
|
|
|
|
+
|
|
|
|
|
+ try:
|
|
|
|
|
+ data = {
|
|
|
|
|
+ 'email': email if email is not None else self._email,
|
|
|
|
|
+ 'token': token,
|
|
|
|
|
+ 'sourcePlatform': source_platform,
|
|
|
|
|
+ 'targetPlatform': target_platform,
|
|
|
|
|
+ 'query': query
|
|
|
|
|
+ }
|
|
|
|
|
+ return self._root.post('/api/queryCompatibility', data=json.dumps(data), contenttype=_JSON_CONTENT_TYPE)
|
|
|
|
|
+ except RestException, e:
|
|
|
|
|
+ raise PopupException(e, title=_('Error while accessing Optimizer'))
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
def OptimizerDataAdapter(queries):
|
|
def OptimizerDataAdapter(queries):
|
|
|
headers = ['SQL_ID', 'ELAPSED_TIME', 'SQL_FULLTEXT']
|
|
headers = ['SQL_ID', 'ELAPSED_TIME', 'SQL_FULLTEXT']
|
|
|
if queries and len(queries[0]) == 3:
|
|
if queries and len(queries[0]) == 3:
|