We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Removing predictor through HTTP returns 500 
If mindsdb config have connection to DB with `publish: True`, but this DB cant be reached, then if removing predictor in Scout will return 'error 500'. That because mindsdb try to remove table related to predictor from database. That error is not critical. Probably, we need return code 200 with 'warnings' in this case, or only code 200.
Request:
```
Request URL: http://localhost:5000/api/predictors/home_days_on_market
Request Method: DELETE
Status Code: 500 INTERNAL SERVER ERROR
response
{"message": "ProgrammingError: 1698 (28000): Access denied for user 'roote'@'localhost'"}
```
error:
```
[2020-12-14 10:40:17,942] ERROR in app: Exception on /api/predictors/home_initial [DELETE]
Traceback (most recent call last):
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py", line 233, in _open_connection
    self._cmysql.connect(**cnx_kwargs)
_mysql_connector.MySQLInterfaceError: Access denied for user 'roote'@'localhost'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask_restx/api.py", line 375, in wrapper
    resp = resource(*args, **kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask_restx/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/api/http/namespaces/predictor.py", line 116, in delete
    ca.mindsdb_native.delete_model(name)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/interfaces/native/mindsdb.py", line 97, in delete_model
    self.dbw.unregister_predictor(name)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/interfaces/database/database.py", line 59, in unregister_predictor
    integration.unregister_predictor(name)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/integrations/mariadb/mariadb.py", line 131, in unregister_predictor
    self._query(q)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/integrations/mariadb/mariadb.py", line 42, in _query
    con = mysql.connector.connect(
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/__init__.py", line 270, in connect
    return CMySQLConnection(*args, **kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py", line 86, in __init__
    self.connect(**kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/abstracts.py", line 985, in connect
    self._open_connection()
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py", line 235, in _open_connection
    raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno,
mysql.connector.errors.ProgrammingError: 1698 (28000): Access denied for user 'roote'@'localhost'
ERROR:mindsdb.api.http.initialize:Exception on /api/predictors/home_initial [DELETE]
Traceback (most recent call last):
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py", line 233, in _open_connection
    self._cmysql.connect(**cnx_kwargs)
_mysql_connector.MySQLInterfaceError: Access denied for user 'roote'@'localhost'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask_restx/api.py", line 375, in wrapper
    resp = resource(*args, **kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask_restx/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/api/http/namespaces/predictor.py", line 116, in delete
    ca.mindsdb_native.delete_model(name)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/interfaces/native/mindsdb.py", line 97, in delete_model
    self.dbw.unregister_predictor(name)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/interfaces/database/database.py", line 59, in unregister_predictor
    integration.unregister_predictor(name)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/integrations/mariadb/mariadb.py", line 131, in unregister_predictor
    self._query(q)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/integrations/mariadb/mariadb.py", line 42, in _query
    con = mysql.connector.connect(
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/__init__.py", line 270, in connect
    return CMySQLConnection(*args, **kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py", line 86, in __init__
    self.connect(**kwargs)
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/abstracts.py", line 985, in connect
    self._open_connection()
  File "/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py", line 235, in _open_connection
    raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno,
mysql.connector.errors.ProgrammingError: 1698 (28000): Access denied for user 'roote'@'localhost'
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mindsdb/interfaces/database/database.py`
Content:
```
1 from mindsdb.integrations.clickhouse.clickhouse import Clickhouse
2 from mindsdb.integrations.postgres.postgres import PostgreSQL
3 from mindsdb.integrations.mariadb.mariadb import Mariadb
4 from mindsdb.integrations.mysql.mysql import MySQL
5 from mindsdb.integrations.mssql.mssql import MSSQL
6 
7 
8 class DatabaseWrapper():
9 
10     def __init__(self, config):
11         self.config = config
12         self._get_integrations()
13 
14     def _setup_integration(self, integration):
15         success = False
16         try:
17             integration.setup()
18             success = True
19         except Exception as e:
20             print('Failed to integrate with database ' + integration.name + f', error: {e}')
21         return success
22 
23     def _get_integrations(self):
24         # @TODO Once we have a presistent state sorted out this should be simplified as to not refresh the existing integrations every single time
25         integration_arr = []
26         for db_alias in self.config['integrations']:
27             if self.config['integrations'][db_alias]['publish']:
28                 db_type = self.config['integrations'][db_alias]['type']
29                 if db_type == 'clickhouse':
30                     integration_arr.append(Clickhouse(self.config, db_alias))
31                 elif db_type == 'mariadb':
32                     integration_arr.append(Mariadb(self.config, db_alias))
33                 elif db_type == 'mysql':
34                     integration_arr.append(MySQL(self.config, db_alias))
35                 elif db_type == 'postgres':
36                     integration_arr.append(PostgreSQL(self.config, db_alias))
37                 elif db_type == 'mssql':
38                     integration_arr.append(MSSQL(self.config, db_alias))
39                 elif db_type == 'mongodb':
40                     pass
41                 else:
42                     print(f'Uknown integration type: {db_type} for database called: {db_alias}')
43 
44         return integration_arr
45 
46     def register_predictors(self, model_data_arr, setup=True):
47         it = self._get_integrations()
48         for integration in it:
49             register = True
50             if setup:
51                 register = self._setup_integration(integration)
52             if register:
53                 integration.register_predictors(model_data_arr)
54 
55             integration = [integration]
56 
57     def unregister_predictor(self, name):
58         for integration in self._get_integrations():
59             integration.unregister_predictor(name)
60 
61     def check_connections(self):
62         connections = {}
63         for integration in self._get_integrations():
64             connections[integration.name] = integration.check_connection()
65 
66         return connections
67
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mindsdb/interfaces/database/database.py b/mindsdb/interfaces/database/database.py
--- a/mindsdb/interfaces/database/database.py
+++ b/mindsdb/interfaces/database/database.py
@@ -4,6 +4,8 @@
 from mindsdb.integrations.mysql.mysql import MySQL
 from mindsdb.integrations.mssql.mssql import MSSQL
 
+from mindsdb.utilities.log import log as logger
+
 
 class DatabaseWrapper():
 
@@ -50,13 +52,19 @@
             if setup:
                 register = self._setup_integration(integration)
             if register:
-                integration.register_predictors(model_data_arr)
+                if integration.check_connection():
+                    integration.register_predictors(model_data_arr)
+                else:
+                    logger.warning(f"There is no connection to {integration.name}. predictor wouldn't be registred.")
 
             integration = [integration]
 
     def unregister_predictor(self, name):
         for integration in self._get_integrations():
-            integration.unregister_predictor(name)
+            if integration.check_connection():
+                integration.unregister_predictor(name)
+            else:
+                logger.warning(f"There is no connection to {integration.name}. predictor wouldn't be unregistred")
 
     def check_connections(self):
         connections = {}

{"golden_diff": "diff --git a/mindsdb/interfaces/database/database.py b/mindsdb/interfaces/database/database.py\n--- a/mindsdb/interfaces/database/database.py\n+++ b/mindsdb/interfaces/database/database.py\n@@ -4,6 +4,8 @@\n from mindsdb.integrations.mysql.mysql import MySQL\n from mindsdb.integrations.mssql.mssql import MSSQL\n \n+from mindsdb.utilities.log import log as logger\n+\n \n class DatabaseWrapper():\n \n@@ -50,13 +52,19 @@\n             if setup:\n                 register = self._setup_integration(integration)\n             if register:\n-                integration.register_predictors(model_data_arr)\n+                if integration.check_connection():\n+                    integration.register_predictors(model_data_arr)\n+                else:\n+                    logger.warning(f\"There is no connection to {integration.name}. predictor wouldn't be registred.\")\n \n             integration = [integration]\n \n     def unregister_predictor(self, name):\n         for integration in self._get_integrations():\n-            integration.unregister_predictor(name)\n+            if integration.check_connection():\n+                integration.unregister_predictor(name)\n+            else:\n+                logger.warning(f\"There is no connection to {integration.name}. predictor wouldn't be unregistred\")\n \n     def check_connections(self):\n         connections = {}\n", "issue": "Removing predictor through HTTP returns 500 \nIf mindsdb config have connection to DB with `publish: True`, but this DB cant be reached, then if removing predictor in Scout will return 'error 500'. That because mindsdb try to remove table related to predictor from database. That error is not critical. Probably, we need return code 200 with 'warnings' in this case, or only code 200.\r\nRequest:\r\n```\r\nRequest URL: http://localhost:5000/api/predictors/home_days_on_market\r\nRequest Method: DELETE\r\nStatus Code: 500 INTERNAL SERVER ERROR\r\nresponse\r\n{\"message\": \"ProgrammingError: 1698 (28000): Access denied for user 'roote'@'localhost'\"}\r\n```\r\nerror:\r\n```\r\n[2020-12-14 10:40:17,942] ERROR in app: Exception on /api/predictors/home_initial [DELETE]\r\nTraceback (most recent call last):\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py\", line 233, in _open_connection\r\n    self._cmysql.connect(**cnx_kwargs)\r\n_mysql_connector.MySQLInterfaceError: Access denied for user 'roote'@'localhost'\r\nDuring handling of the above exception, another exception occurred:\r\nTraceback (most recent call last):\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/app.py\", line 1950, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/app.py\", line 1936, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask_restx/api.py\", line 375, in wrapper\r\n    resp = resource(*args, **kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/views.py\", line 89, in view\r\n    return self.dispatch_request(*args, **kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask_restx/resource.py\", line 44, in dispatch_request\r\n    resp = meth(*args, **kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/api/http/namespaces/predictor.py\", line 116, in delete\r\n    ca.mindsdb_native.delete_model(name)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/interfaces/native/mindsdb.py\", line 97, in delete_model\r\n    self.dbw.unregister_predictor(name)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/interfaces/database/database.py\", line 59, in unregister_predictor\r\n    integration.unregister_predictor(name)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/integrations/mariadb/mariadb.py\", line 131, in unregister_predictor\r\n    self._query(q)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/integrations/mariadb/mariadb.py\", line 42, in _query\r\n    con = mysql.connector.connect(\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/__init__.py\", line 270, in connect\r\n    return CMySQLConnection(*args, **kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py\", line 86, in __init__\r\n    self.connect(**kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/abstracts.py\", line 985, in connect\r\n    self._open_connection()\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py\", line 235, in _open_connection\r\n    raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno,\r\nmysql.connector.errors.ProgrammingError: 1698 (28000): Access denied for user 'roote'@'localhost'\r\nERROR:mindsdb.api.http.initialize:Exception on /api/predictors/home_initial [DELETE]\r\nTraceback (most recent call last):\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py\", line 233, in _open_connection\r\n    self._cmysql.connect(**cnx_kwargs)\r\n_mysql_connector.MySQLInterfaceError: Access denied for user 'roote'@'localhost'\r\nDuring handling of the above exception, another exception occurred:\r\nTraceback (most recent call last):\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/app.py\", line 1950, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/app.py\", line 1936, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask_restx/api.py\", line 375, in wrapper\r\n    resp = resource(*args, **kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask/views.py\", line 89, in view\r\n    return self.dispatch_request(*args, **kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/flask_restx/resource.py\", line 44, in dispatch_request\r\n    resp = meth(*args, **kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/api/http/namespaces/predictor.py\", line 116, in delete\r\n    ca.mindsdb_native.delete_model(name)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/interfaces/native/mindsdb.py\", line 97, in delete_model\r\n    self.dbw.unregister_predictor(name)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/interfaces/database/database.py\", line 59, in unregister_predictor\r\n    integration.unregister_predictor(name)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/integrations/mariadb/mariadb.py\", line 131, in unregister_predictor\r\n    self._query(q)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/mindsdb/mindsdb/integrations/mariadb/mariadb.py\", line 42, in _query\r\n    con = mysql.connector.connect(\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/__init__.py\", line 270, in connect\r\n    return CMySQLConnection(*args, **kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py\", line 86, in __init__\r\n    self.connect(**kwargs)\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/abstracts.py\", line 985, in connect\r\n    self._open_connection()\r\n  File \"/Users/alejo/Documents/mindsdb/venv-mindsdb/lib/python3.8/site-packages/mysql/connector/connection_cext.py\", line 235, in _open_connection\r\n    raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno,\r\nmysql.connector.errors.ProgrammingError: 1698 (28000): Access denied for user 'roote'@'localhost'\r\n```\n", "before_files": [{"content": "from mindsdb.integrations.clickhouse.clickhouse import Clickhouse\nfrom mindsdb.integrations.postgres.postgres import PostgreSQL\nfrom mindsdb.integrations.mariadb.mariadb import Mariadb\nfrom mindsdb.integrations.mysql.mysql import MySQL\nfrom mindsdb.integrations.mssql.mssql import MSSQL\n\n\nclass DatabaseWrapper():\n\n    def __init__(self, config):\n        self.config = config\n        self._get_integrations()\n\n    def _setup_integration(self, integration):\n        success = False\n        try:\n            integration.setup()\n            success = True\n        except Exception as e:\n            print('Failed to integrate with database ' + integration.name + f', error: {e}')\n        return success\n\n    def _get_integrations(self):\n        # @TODO Once we have a presistent state sorted out this should be simplified as to not refresh the existing integrations every single time\n        integration_arr = []\n        for db_alias in self.config['integrations']:\n            if self.config['integrations'][db_alias]['publish']:\n                db_type = self.config['integrations'][db_alias]['type']\n                if db_type == 'clickhouse':\n                    integration_arr.append(Clickhouse(self.config, db_alias))\n                elif db_type == 'mariadb':\n                    integration_arr.append(Mariadb(self.config, db_alias))\n                elif db_type == 'mysql':\n                    integration_arr.append(MySQL(self.config, db_alias))\n                elif db_type == 'postgres':\n                    integration_arr.append(PostgreSQL(self.config, db_alias))\n                elif db_type == 'mssql':\n                    integration_arr.append(MSSQL(self.config, db_alias))\n                elif db_type == 'mongodb':\n                    pass\n                else:\n                    print(f'Uknown integration type: {db_type} for database called: {db_alias}')\n\n        return integration_arr\n\n    def register_predictors(self, model_data_arr, setup=True):\n        it = self._get_integrations()\n        for integration in it:\n            register = True\n            if setup:\n                register = self._setup_integration(integration)\n            if register:\n                integration.register_predictors(model_data_arr)\n\n            integration = [integration]\n\n    def unregister_predictor(self, name):\n        for integration in self._get_integrations():\n            integration.unregister_predictor(name)\n\n    def check_connections(self):\n        connections = {}\n        for integration in self._get_integrations():\n            connections[integration.name] = integration.check_connection()\n\n        return connections\n", "path": "mindsdb/interfaces/database/database.py"}], "after_files": [{"content": "from mindsdb.integrations.clickhouse.clickhouse import Clickhouse\nfrom mindsdb.integrations.postgres.postgres import PostgreSQL\nfrom mindsdb.integrations.mariadb.mariadb import Mariadb\nfrom mindsdb.integrations.mysql.mysql import MySQL\nfrom mindsdb.integrations.mssql.mssql import MSSQL\n\nfrom mindsdb.utilities.log import log as logger\n\n\nclass DatabaseWrapper():\n\n    def __init__(self, config):\n        self.config = config\n        self._get_integrations()\n\n    def _setup_integration(self, integration):\n        success = False\n        try:\n            integration.setup()\n            success = True\n        except Exception as e:\n            print('Failed to integrate with database ' + integration.name + f', error: {e}')\n        return success\n\n    def _get_integrations(self):\n        # @TODO Once we have a presistent state sorted out this should be simplified as to not refresh the existing integrations every single time\n        integration_arr = []\n        for db_alias in self.config['integrations']:\n            if self.config['integrations'][db_alias]['publish']:\n                db_type = self.config['integrations'][db_alias]['type']\n                if db_type == 'clickhouse':\n                    integration_arr.append(Clickhouse(self.config, db_alias))\n                elif db_type == 'mariadb':\n                    integration_arr.append(Mariadb(self.config, db_alias))\n                elif db_type == 'mysql':\n                    integration_arr.append(MySQL(self.config, db_alias))\n                elif db_type == 'postgres':\n                    integration_arr.append(PostgreSQL(self.config, db_alias))\n                elif db_type == 'mssql':\n                    integration_arr.append(MSSQL(self.config, db_alias))\n                elif db_type == 'mongodb':\n                    pass\n                else:\n                    print(f'Uknown integration type: {db_type} for database called: {db_alias}')\n\n        return integration_arr\n\n    def register_predictors(self, model_data_arr, setup=True):\n        it = self._get_integrations()\n        for integration in it:\n            register = True\n            if setup:\n                register = self._setup_integration(integration)\n            if register:\n                if integration.check_connection():\n                    integration.register_predictors(model_data_arr)\n                else:\n                    logger.warning(f\"There is no connection to {integration.name}. predictor wouldn't be registred.\")\n\n            integration = [integration]\n\n    def unregister_predictor(self, name):\n        for integration in self._get_integrations():\n            if integration.check_connection():\n                integration.unregister_predictor(name)\n            else:\n                logger.warning(f\"There is no connection to {integration.name}. predictor wouldn't be unregistred\")\n\n    def check_connections(self):\n        connections = {}\n        for integration in self._get_integrations():\n            connections[integration.name] = integration.check_connection()\n\n        return connections\n", "path": "mindsdb/interfaces/database/database.py"}]}