MindsDB 1.2.9__py3-none-any.whl → 24.12.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of MindsDB might be problematic. Click here for more details.
- MindsDB-24.12.4.0.dist-info/LICENSE +199 -0
- MindsDB-24.12.4.0.dist-info/METADATA +910 -0
- MindsDB-24.12.4.0.dist-info/RECORD +1922 -0
- {MindsDB-1.2.9.dist-info → MindsDB-24.12.4.0.dist-info}/WHEEL +1 -1
- mindsdb/__about__.py +5 -5
- mindsdb/__init__.py +1 -11
- mindsdb/__main__.py +556 -0
- mindsdb/api/common/check_auth.py +42 -0
- mindsdb/api/executor/__init__.py +2 -0
- mindsdb/api/executor/command_executor.py +2047 -0
- mindsdb/api/executor/controllers/__init__.py +1 -0
- mindsdb/api/executor/controllers/session_controller.py +91 -0
- mindsdb/api/executor/data_types/answer.py +16 -0
- mindsdb/api/executor/data_types/response_type.py +8 -0
- mindsdb/api/executor/datahub/__init__.py +1 -0
- mindsdb/api/executor/datahub/classes/tables_row.py +65 -0
- mindsdb/api/executor/datahub/datanodes/__init__.py +4 -0
- mindsdb/api/executor/datahub/datanodes/datanode.py +20 -0
- mindsdb/api/executor/datahub/datanodes/information_schema_datanode.py +180 -0
- mindsdb/api/executor/datahub/datanodes/integration_datanode.py +281 -0
- mindsdb/api/executor/datahub/datanodes/mindsdb_tables.py +428 -0
- mindsdb/api/executor/datahub/datanodes/project_datanode.py +186 -0
- mindsdb/api/executor/datahub/datanodes/system_tables.py +525 -0
- mindsdb/api/executor/exceptions.py +39 -0
- mindsdb/api/executor/planner/__init__.py +5 -0
- mindsdb/api/executor/planner/exceptions.py +3 -0
- mindsdb/api/executor/planner/plan_join.py +640 -0
- mindsdb/api/executor/planner/plan_join_ts.py +384 -0
- mindsdb/api/executor/planner/query_plan.py +29 -0
- mindsdb/api/executor/planner/query_planner.py +837 -0
- mindsdb/api/executor/planner/query_prepare.py +527 -0
- mindsdb/api/executor/planner/step_result.py +19 -0
- mindsdb/api/executor/planner/steps.py +262 -0
- mindsdb/api/executor/planner/ts_utils.py +93 -0
- mindsdb/api/executor/planner/utils.py +126 -0
- mindsdb/api/executor/sql_query/result_set.py +312 -0
- mindsdb/api/executor/sql_query/sql_query.py +318 -0
- mindsdb/api/executor/sql_query/steps/__init__.py +13 -0
- mindsdb/api/executor/sql_query/steps/apply_predictor_step.py +424 -0
- mindsdb/api/executor/sql_query/steps/base.py +21 -0
- mindsdb/api/executor/sql_query/steps/delete_step.py +49 -0
- mindsdb/api/executor/sql_query/steps/fetch_dataframe.py +116 -0
- mindsdb/api/executor/sql_query/steps/insert_step.py +129 -0
- mindsdb/api/executor/sql_query/steps/join_step.py +109 -0
- mindsdb/api/executor/sql_query/steps/map_reduce_step.py +179 -0
- mindsdb/api/executor/sql_query/steps/multiple_step.py +24 -0
- mindsdb/api/executor/sql_query/steps/prepare_steps.py +59 -0
- mindsdb/api/executor/sql_query/steps/project_step.py +86 -0
- mindsdb/api/executor/sql_query/steps/sql_steps.py +41 -0
- mindsdb/api/executor/sql_query/steps/subselect_step.py +159 -0
- mindsdb/api/executor/sql_query/steps/union_step.py +56 -0
- mindsdb/api/executor/sql_query/steps/update_step.py +129 -0
- mindsdb/api/executor/utilities/functions.py +37 -0
- mindsdb/api/executor/utilities/sql.py +195 -0
- mindsdb/api/http/gui.py +94 -0
- mindsdb/api/http/gunicorn_wrapper.py +17 -0
- mindsdb/api/http/initialize.py +454 -0
- mindsdb/api/http/namespaces/agents.py +499 -0
- mindsdb/api/http/namespaces/analysis.py +117 -0
- mindsdb/api/http/namespaces/auth.py +167 -0
- mindsdb/api/http/namespaces/chatbots.py +318 -0
- mindsdb/api/http/namespaces/config.py +286 -0
- mindsdb/api/http/namespaces/configs/agents.py +3 -0
- mindsdb/api/http/namespaces/configs/analysis.py +3 -0
- mindsdb/api/http/namespaces/configs/auth.py +4 -0
- mindsdb/api/http/namespaces/configs/chatbots.py +3 -0
- mindsdb/api/http/namespaces/configs/config.py +3 -0
- mindsdb/api/http/namespaces/configs/databases.py +3 -0
- mindsdb/api/http/namespaces/configs/default.py +4 -0
- mindsdb/api/http/namespaces/configs/files.py +4 -0
- mindsdb/api/http/namespaces/configs/handlers.py +3 -0
- mindsdb/api/http/namespaces/configs/jobs.py +3 -0
- mindsdb/api/http/namespaces/configs/knowledge_bases.py +3 -0
- mindsdb/api/http/namespaces/configs/projects.py +3 -0
- mindsdb/api/http/namespaces/configs/skills.py +3 -0
- mindsdb/api/http/namespaces/configs/sql.py +3 -0
- mindsdb/api/http/namespaces/configs/tabs.py +3 -0
- mindsdb/api/http/namespaces/configs/tree.py +3 -0
- mindsdb/api/http/namespaces/configs/util.py +3 -0
- mindsdb/api/http/namespaces/configs/webhooks.py +3 -0
- mindsdb/api/http/namespaces/databases.py +394 -0
- mindsdb/api/http/namespaces/default.py +152 -0
- mindsdb/api/http/namespaces/file.py +191 -0
- mindsdb/api/http/namespaces/handlers.py +232 -0
- mindsdb/api/http/namespaces/jobs.py +99 -0
- mindsdb/api/http/namespaces/knowledge_bases.py +420 -0
- mindsdb/api/http/namespaces/models.py +297 -0
- mindsdb/api/http/namespaces/projects.py +46 -0
- mindsdb/api/http/namespaces/skills.py +170 -0
- mindsdb/api/http/namespaces/sql.py +162 -0
- mindsdb/api/http/namespaces/tab.py +131 -0
- mindsdb/api/http/namespaces/tree.py +105 -0
- mindsdb/api/http/namespaces/util.py +144 -0
- mindsdb/api/http/namespaces/views.py +153 -0
- mindsdb/api/http/namespaces/webhooks.py +29 -0
- mindsdb/api/http/start.py +67 -0
- mindsdb/api/http/utils.py +37 -0
- mindsdb/api/mongo/classes/__init__.py +5 -0
- mindsdb/api/mongo/classes/query_sql.py +18 -0
- mindsdb/api/mongo/classes/responder.py +45 -0
- mindsdb/api/mongo/classes/responder_collection.py +34 -0
- mindsdb/api/mongo/classes/scram.py +86 -0
- mindsdb/api/mongo/classes/session.py +23 -0
- mindsdb/api/mongo/functions/__init__.py +19 -0
- mindsdb/api/mongo/responders/__init__.py +73 -0
- mindsdb/api/mongo/responders/add_shard.py +13 -0
- mindsdb/api/mongo/responders/aggregate.py +90 -0
- mindsdb/api/mongo/responders/buildinfo.py +17 -0
- mindsdb/api/mongo/responders/coll_stats.py +62 -0
- mindsdb/api/mongo/responders/company_id.py +25 -0
- mindsdb/api/mongo/responders/connection_status.py +22 -0
- mindsdb/api/mongo/responders/count.py +21 -0
- mindsdb/api/mongo/responders/db_stats.py +31 -0
- mindsdb/api/mongo/responders/delete.py +105 -0
- mindsdb/api/mongo/responders/describe.py +23 -0
- mindsdb/api/mongo/responders/end_sessions.py +13 -0
- mindsdb/api/mongo/responders/find.py +175 -0
- mindsdb/api/mongo/responders/get_cmd_line_opts.py +18 -0
- mindsdb/api/mongo/responders/get_free_monitoring_status.py +14 -0
- mindsdb/api/mongo/responders/get_parameter.py +23 -0
- mindsdb/api/mongo/responders/getlog.py +14 -0
- mindsdb/api/mongo/responders/host_info.py +28 -0
- mindsdb/api/mongo/responders/insert.py +268 -0
- mindsdb/api/mongo/responders/is_master.py +20 -0
- mindsdb/api/mongo/responders/is_master_lower.py +13 -0
- mindsdb/api/mongo/responders/list_collections.py +55 -0
- mindsdb/api/mongo/responders/list_databases.py +37 -0
- mindsdb/api/mongo/responders/list_indexes.py +22 -0
- mindsdb/api/mongo/responders/ping.py +13 -0
- mindsdb/api/mongo/responders/recv_chunk_start.py +13 -0
- mindsdb/api/mongo/responders/replsetgetstatus.py +13 -0
- mindsdb/api/mongo/responders/sasl_continue.py +34 -0
- mindsdb/api/mongo/responders/sasl_start.py +33 -0
- mindsdb/api/mongo/responders/update_range_deletions.py +12 -0
- mindsdb/api/mongo/responders/whatsmyuri.py +18 -0
- mindsdb/api/mongo/server.py +388 -0
- mindsdb/api/mongo/start.py +15 -0
- mindsdb/api/mongo/utilities/mongodb_ast.py +257 -0
- mindsdb/api/mongo/utilities/mongodb_parser.py +145 -0
- mindsdb/api/mongo/utilities/mongodb_query.py +84 -0
- mindsdb/api/mysql/mysql_proxy/classes/client_capabilities.py +130 -0
- mindsdb/api/mysql/mysql_proxy/classes/fake_mysql_proxy/__init__.py +3 -0
- mindsdb/api/mysql/mysql_proxy/classes/fake_mysql_proxy/fake_mysql_proxy.py +37 -0
- mindsdb/api/mysql/mysql_proxy/classes/server_capabilities.py +22 -0
- mindsdb/api/mysql/mysql_proxy/classes/sql_statement_parser.py +151 -0
- mindsdb/api/mysql/mysql_proxy/data_types/__init__.py +0 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_datum.py +212 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packet.py +166 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/__init__.py +15 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/binary_resultset_row_package.py +140 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/column_count_packet.py +44 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/column_definition_packet.py +94 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/command_packet.py +159 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/eof_packet.py +52 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/err_packet.py +58 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/fast_auth_fail_packet.py +20 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/handshake_packet.py +80 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/handshake_response_packet.py +96 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/ok_packet.py +106 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/password_answer.py +13 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/resultset_row_package.py +54 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/stmt_prepare_header.py +46 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/switch_auth_packet.py +53 -0
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/switch_auth_response_packet.py +16 -0
- mindsdb/api/mysql/mysql_proxy/executor/__init__.py +2 -0
- mindsdb/api/mysql/mysql_proxy/executor/mysql_executor.py +138 -0
- mindsdb/api/mysql/mysql_proxy/external_libs/__init__.py +0 -0
- mindsdb/api/mysql/mysql_proxy/external_libs/mysql_scramble.py +135 -0
- mindsdb/api/mysql/mysql_proxy/libs/__init__.py +1 -0
- mindsdb/api/mysql/mysql_proxy/libs/constants/__init__.py +1 -0
- mindsdb/api/mysql/mysql_proxy/libs/constants/mysql.py +1030 -0
- mindsdb/api/mysql/mysql_proxy/mysql_proxy.py +930 -0
- mindsdb/api/mysql/mysql_proxy/utilities/__init__.py +1 -0
- mindsdb/api/mysql/mysql_proxy/utilities/exceptions.py +18 -0
- mindsdb/api/mysql/mysql_proxy/utilities/lightwood_dtype.py +48 -0
- mindsdb/api/mysql/start.py +13 -0
- mindsdb/api/postgres/__init__.py +0 -0
- mindsdb/api/postgres/postgres_proxy/__init__.py +0 -0
- mindsdb/api/postgres/postgres_proxy/executor/__init__.py +1 -0
- mindsdb/api/postgres/postgres_proxy/executor/executor.py +188 -0
- mindsdb/api/postgres/postgres_proxy/postgres_packets/__init__.py +0 -0
- mindsdb/api/postgres/postgres_proxy/postgres_packets/errors.py +322 -0
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_fields.py +34 -0
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message.py +31 -0
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message_formats.py +1265 -0
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message_identifiers.py +31 -0
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_packets.py +253 -0
- mindsdb/api/postgres/postgres_proxy/postgres_proxy.py +479 -0
- mindsdb/api/postgres/postgres_proxy/utilities/__init__.py +10 -0
- mindsdb/api/postgres/start.py +11 -0
- mindsdb/integrations/__init__.py +0 -0
- mindsdb/integrations/handlers/__init__.py +0 -0
- mindsdb/integrations/handlers/access_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/access_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/access_handler/access_handler.py +197 -0
- mindsdb/integrations/handlers/access_handler/connection_args.py +15 -0
- mindsdb/integrations/handlers/access_handler/icon.svg +19 -0
- mindsdb/integrations/handlers/access_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/access_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/access_handler/tests/test_access_handler.py +32 -0
- mindsdb/integrations/handlers/aerospike_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/aerospike_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/aerospike_handler/aerospike_handler.py +236 -0
- mindsdb/integrations/handlers/aerospike_handler/connection_args.py +46 -0
- mindsdb/integrations/handlers/aerospike_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/aerospike_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/aerospike_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/aerospike_handler/tests/test_aerospike_handler.py +36 -0
- mindsdb/integrations/handlers/airtable_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/airtable_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/airtable_handler/airtable_handler.py +211 -0
- mindsdb/integrations/handlers/airtable_handler/connection_args.py +26 -0
- mindsdb/integrations/handlers/airtable_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/airtable_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/airtable_handler/tests/test_airtable_handler.py +34 -0
- mindsdb/integrations/handlers/altibase_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/altibase_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/altibase_handler/altibase_handler.py +253 -0
- mindsdb/integrations/handlers/altibase_handler/connection_args.py +50 -0
- mindsdb/integrations/handlers/altibase_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/altibase_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/altibase_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/altibase_handler/tests/test_altibase_handler.py +67 -0
- mindsdb/integrations/handlers/altibase_handler/tests/test_altibase_handler_dsn.py +68 -0
- mindsdb/integrations/handlers/anomaly_detection_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/anomaly_detection_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/anomaly_detection_handler/anomaly_detection_handler.py +180 -0
- mindsdb/integrations/handlers/anomaly_detection_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/anomaly_detection_handler/requirements.txt +4 -0
- mindsdb/integrations/handlers/anomaly_detection_handler/utils.py +21 -0
- mindsdb/integrations/handlers/anthropic_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/anthropic_handler/__init__.py +22 -0
- mindsdb/integrations/handlers/anthropic_handler/anthropic_handler.py +108 -0
- mindsdb/integrations/handlers/anthropic_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/anthropic_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/anyscale_endpoints_handler.py +290 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/creation_args.py +14 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/requirements.txt +3 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/settings.py +51 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/anyscale_endpoints_handler/tests/test_anyscale_endpoints_handler.py +212 -0
- mindsdb/integrations/handlers/apache_doris_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/apache_doris_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/apache_doris_handler/apache_doris_handler.py +10 -0
- mindsdb/integrations/handlers/apache_doris_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/apache_doris_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/aqicn_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/aqicn_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/aqicn_handler/aqicn.py +35 -0
- mindsdb/integrations/handlers/aqicn_handler/aqicn_handler.py +97 -0
- mindsdb/integrations/handlers/aqicn_handler/aqicn_tables.py +425 -0
- mindsdb/integrations/handlers/aqicn_handler/connection_args.py +18 -0
- mindsdb/integrations/handlers/aqicn_handler/icon.png +0 -0
- mindsdb/integrations/handlers/aqicn_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/athena_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/athena_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/athena_handler/athena_handler.py +218 -0
- mindsdb/integrations/handlers/athena_handler/connection_args.py +51 -0
- mindsdb/integrations/handlers/athena_handler/icon.svg +22 -0
- mindsdb/integrations/handlers/athena_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/athena_handler/tests/test_athena_handler.py +85 -0
- mindsdb/integrations/handlers/aurora_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/aurora_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/aurora_handler/aurora_handler.py +140 -0
- mindsdb/integrations/handlers/aurora_handler/connection_args.py +50 -0
- mindsdb/integrations/handlers/aurora_handler/icon.svg +7 -0
- mindsdb/integrations/handlers/aurora_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/aurora_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/aurora_handler/tests/test_aurora_mysql_handler.py +37 -0
- mindsdb/integrations/handlers/aurora_handler/tests/test_aurora_postgres_handler.py +37 -0
- mindsdb/integrations/handlers/autogluon_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/autogluon_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/autogluon_handler/autogluon_handler.py +57 -0
- mindsdb/integrations/handlers/autogluon_handler/config.py +17 -0
- mindsdb/integrations/handlers/autogluon_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/autogluon_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/autokeras_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/autokeras_handler/__init__.py +22 -0
- mindsdb/integrations/handlers/autokeras_handler/autokeras_handler.py +139 -0
- mindsdb/integrations/handlers/autokeras_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/autokeras_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/autosklearn_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/autosklearn_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/autosklearn_handler/autosklearn_handler.py +53 -0
- mindsdb/integrations/handlers/autosklearn_handler/config.py +29 -0
- mindsdb/integrations/handlers/autosklearn_handler/icon.png +0 -0
- mindsdb/integrations/handlers/autosklearn_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/azure_blob_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/azure_blob_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/azure_blob_handler/azure_blob_handler.py +346 -0
- mindsdb/integrations/handlers/azure_blob_handler/connection_args.py +25 -0
- mindsdb/integrations/handlers/azure_blob_handler/icon.svg +30 -0
- mindsdb/integrations/handlers/azure_blob_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/bedrock_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/bedrock_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/bedrock_handler/bedrock_handler.py +328 -0
- mindsdb/integrations/handlers/bedrock_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/bedrock_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/bedrock_handler/settings.py +287 -0
- mindsdb/integrations/handlers/bedrock_handler/utilities.py +46 -0
- mindsdb/integrations/handlers/bigquery_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/bigquery_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/bigquery_handler/bigquery_handler.py +181 -0
- mindsdb/integrations/handlers/bigquery_handler/connection_args.py +30 -0
- mindsdb/integrations/handlers/bigquery_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/bigquery_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/bigquery_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/bigquery_handler/tests/test_bigquery_handler.py +221 -0
- mindsdb/integrations/handlers/binance_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/binance_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/binance_handler/binance_handler.py +144 -0
- mindsdb/integrations/handlers/binance_handler/binance_tables.py +175 -0
- mindsdb/integrations/handlers/binance_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/binance_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/box_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/box_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/box_handler/box_handler.py +257 -0
- mindsdb/integrations/handlers/box_handler/connection_args.py +17 -0
- mindsdb/integrations/handlers/box_handler/icon.svg +1 -0
- mindsdb/integrations/handlers/box_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/byom_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/byom_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/byom_handler/byom_handler.py +678 -0
- mindsdb/integrations/handlers/byom_handler/connection_args.py +19 -0
- mindsdb/integrations/handlers/byom_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/byom_handler/proc_wrapper.py +229 -0
- mindsdb/integrations/handlers/byom_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/cassandra_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/cassandra_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/cassandra_handler/cassandra_handler.py +27 -0
- mindsdb/integrations/handlers/cassandra_handler/connection_args.py +50 -0
- mindsdb/integrations/handlers/cassandra_handler/icon.svg +33 -0
- mindsdb/integrations/handlers/cassandra_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/cassandra_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/cassandra_handler/tests/test_cassandra_handler.py +39 -0
- mindsdb/integrations/handlers/chromadb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/chromadb_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/chromadb_handler/chromadb_handler.py +491 -0
- mindsdb/integrations/handlers/chromadb_handler/connection_args.py +28 -0
- mindsdb/integrations/handlers/chromadb_handler/icon.png +0 -0
- mindsdb/integrations/handlers/chromadb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/chromadb_handler/settings.py +62 -0
- mindsdb/integrations/handlers/chromadb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/ckan_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/ckan_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/ckan_handler/ckan_handler.py +310 -0
- mindsdb/integrations/handlers/ckan_handler/connection_args.py +22 -0
- mindsdb/integrations/handlers/ckan_handler/icon.png +0 -0
- mindsdb/integrations/handlers/ckan_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/ckan_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/ckan_handler/tests/test_ckan_handler.py +156 -0
- mindsdb/integrations/handlers/clickhouse_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/clickhouse_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/clickhouse_handler/clickhouse_handler.py +168 -0
- mindsdb/integrations/handlers/clickhouse_handler/connection_args.py +53 -0
- mindsdb/integrations/handlers/clickhouse_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/clickhouse_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/clickhouse_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/clickhouse_handler/tests/test_clickhouse_handler.py +41 -0
- mindsdb/integrations/handlers/clipdrop_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/clipdrop_handler/__init__.py +22 -0
- mindsdb/integrations/handlers/clipdrop_handler/clipdrop.py +87 -0
- mindsdb/integrations/handlers/clipdrop_handler/clipdrop_handler.py +193 -0
- mindsdb/integrations/handlers/clipdrop_handler/icon.svg +6 -0
- mindsdb/integrations/handlers/cloud_spanner_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/cloud_spanner_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/cloud_spanner_handler/cloud_spanner_handler.py +219 -0
- mindsdb/integrations/handlers/cloud_spanner_handler/connection_args.py +33 -0
- mindsdb/integrations/handlers/cloud_spanner_handler/icon.png +0 -0
- mindsdb/integrations/handlers/cloud_spanner_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/cloud_spanner_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/cloud_spanner_handler/tests/test_cloud_spanner_handler.py +50 -0
- mindsdb/integrations/handlers/cloud_sql_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/cloud_sql_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/cloud_sql_handler/cloud_sql_handler.py +123 -0
- mindsdb/integrations/handlers/cloud_sql_handler/connection_args.py +41 -0
- mindsdb/integrations/handlers/cloud_sql_handler/icon.png +0 -0
- mindsdb/integrations/handlers/cloud_sql_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/cloud_sql_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/cloud_sql_handler/tests/test_cloud_sql_mssql_handler.py +37 -0
- mindsdb/integrations/handlers/cloud_sql_handler/tests/test_cloud_sql_mysql_handler.py +37 -0
- mindsdb/integrations/handlers/cockroach_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/cockroach_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/cockroach_handler/cockroach_handler.py +11 -0
- mindsdb/integrations/handlers/cockroach_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/cockroach_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/cockroach_handler/tests/test_cockroachdb_handler.py +34 -0
- mindsdb/integrations/handlers/cohere_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/cohere_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/cohere_handler/cohere_handler.py +88 -0
- mindsdb/integrations/handlers/cohere_handler/icon.svg +12 -0
- mindsdb/integrations/handlers/cohere_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/coinbase_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/coinbase_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/coinbase_handler/coinbase_handler.py +138 -0
- mindsdb/integrations/handlers/coinbase_handler/coinbase_tables.py +56 -0
- mindsdb/integrations/handlers/coinbase_handler/connection_args.py +34 -0
- mindsdb/integrations/handlers/coinbase_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/coinbase_handler/requirements.txt +0 -0
- mindsdb/integrations/handlers/confluence_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/confluence_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/confluence_handler/confluence_handler.py +102 -0
- mindsdb/integrations/handlers/confluence_handler/confluence_table.py +193 -0
- mindsdb/integrations/handlers/confluence_handler/connection_args.py +32 -0
- mindsdb/integrations/handlers/confluence_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/confluence_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/confluence_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/confluence_handler/tests/test_confluence_handler.py +68 -0
- mindsdb/integrations/handlers/couchbase_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/couchbase_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/couchbase_handler/connection_args.py +31 -0
- mindsdb/integrations/handlers/couchbase_handler/couchbase_handler.py +208 -0
- mindsdb/integrations/handlers/couchbase_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/couchbase_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/couchbase_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/couchbase_handler/tests/test_couchbase_handler.py +39 -0
- mindsdb/integrations/handlers/couchbasevector_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/couchbasevector_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/couchbasevector_handler/connection_args.py +31 -0
- mindsdb/integrations/handlers/couchbasevector_handler/couchbasevector_handler.py +472 -0
- mindsdb/integrations/handlers/couchbasevector_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/couchbasevector_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/couchbasevector_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/crate_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/crate_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/crate_handler/crate_handler.py +226 -0
- mindsdb/integrations/handlers/crate_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/crate_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/crate_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/crate_handler/tests/test_crate_handler.py +46 -0
- mindsdb/integrations/handlers/d0lt_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/d0lt_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/d0lt_handler/d0lt_handler.py +12 -0
- mindsdb/integrations/handlers/d0lt_handler/icon.svg +6 -0
- mindsdb/integrations/handlers/d0lt_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/d0lt_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/d0lt_handler/tests/test_d0lt_handler.py +53 -0
- mindsdb/integrations/handlers/databend_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/databend_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/databend_handler/connection_args.py +36 -0
- mindsdb/integrations/handlers/databend_handler/databend_handler.py +199 -0
- mindsdb/integrations/handlers/databend_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/databend_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/databend_handler/tests/__init__.py +1 -0
- mindsdb/integrations/handlers/databend_handler/tests/test_databend_handler.py +37 -0
- mindsdb/integrations/handlers/databricks_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/databricks_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/databricks_handler/connection_args.py +58 -0
- mindsdb/integrations/handlers/databricks_handler/databricks_handler.py +261 -0
- mindsdb/integrations/handlers/databricks_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/databricks_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/databricks_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/databricks_handler/tests/test_databricks_handler.py +37 -0
- mindsdb/integrations/handlers/datastax_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/datastax_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/datastax_handler/datastax_handler.py +12 -0
- mindsdb/integrations/handlers/datastax_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/datastax_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/datastax_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/datastax_handler/tests/test_cassandra_handler.py +38 -0
- mindsdb/integrations/handlers/db2_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/db2_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/db2_handler/connection_args.py +53 -0
- mindsdb/integrations/handlers/db2_handler/db2_handler.py +235 -0
- mindsdb/integrations/handlers/db2_handler/icon.svg +49 -0
- mindsdb/integrations/handlers/db2_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/db2_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/db2_handler/tests/test_db2_handler.py +46 -0
- mindsdb/integrations/handlers/derby_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/derby_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/derby_handler/connection_args.py +50 -0
- mindsdb/integrations/handlers/derby_handler/derby_handler.py +203 -0
- mindsdb/integrations/handlers/derby_handler/icon.svg +21 -0
- mindsdb/integrations/handlers/derby_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/derby_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/derby_handler/tests/test_derby_handler.py +46 -0
- mindsdb/integrations/handlers/discord_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/discord_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/discord_handler/discord_handler.py +187 -0
- mindsdb/integrations/handlers/discord_handler/discord_tables.py +189 -0
- mindsdb/integrations/handlers/discord_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/discord_handler/requirements.txt +0 -0
- mindsdb/integrations/handlers/discord_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/discord_handler/tests/test_discord.py +59 -0
- mindsdb/integrations/handlers/dockerhub_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/dockerhub_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/dockerhub_handler/connection_args.py +25 -0
- mindsdb/integrations/handlers/dockerhub_handler/dockerhub.py +55 -0
- mindsdb/integrations/handlers/dockerhub_handler/dockerhub_handler.py +112 -0
- mindsdb/integrations/handlers/dockerhub_handler/dockerhub_tables.py +509 -0
- mindsdb/integrations/handlers/dockerhub_handler/icon.svg +12 -0
- mindsdb/integrations/handlers/documentdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/documentdb_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/documentdb_handler/connection_args.py +53 -0
- mindsdb/integrations/handlers/documentdb_handler/documentdb_handler.py +41 -0
- mindsdb/integrations/handlers/documentdb_handler/icon.svg +15 -0
- mindsdb/integrations/handlers/dremio_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/dremio_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/dremio_handler/connection_args.py +31 -0
- mindsdb/integrations/handlers/dremio_handler/dremio_handler.py +222 -0
- mindsdb/integrations/handlers/dremio_handler/icon.svg +16 -0
- mindsdb/integrations/handlers/dremio_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/dremio_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/dremio_handler/tests/test_dremio_handler.py +35 -0
- mindsdb/integrations/handlers/dropbox_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/dropbox_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/dropbox_handler/connection_args.py +17 -0
- mindsdb/integrations/handlers/dropbox_handler/dropbox_handler.py +253 -0
- mindsdb/integrations/handlers/dropbox_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/dropbox_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/dropbox_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/dropbox_handler/tests/test_dropbox_handler.py +18 -0
- mindsdb/integrations/handlers/druid_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/druid_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/druid_handler/connection_args.py +51 -0
- mindsdb/integrations/handlers/druid_handler/druid_handler.py +216 -0
- mindsdb/integrations/handlers/druid_handler/icon.svg +6 -0
- mindsdb/integrations/handlers/druid_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/druid_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/druid_handler/tests/test_druid_handler.py +35 -0
- mindsdb/integrations/handlers/dspy_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/dspy_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/dspy_handler/dspy_handler.py +250 -0
- mindsdb/integrations/handlers/dspy_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/dspy_handler/requirements.txt +8 -0
- mindsdb/integrations/handlers/duckdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/duckdb_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/duckdb_handler/connection_args.py +17 -0
- mindsdb/integrations/handlers/duckdb_handler/duckdb_handler.py +170 -0
- mindsdb/integrations/handlers/duckdb_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/duckdb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/duckdb_handler/tests/test_duckdb_handler.py +48 -0
- mindsdb/integrations/handlers/dummy_data_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/dummy_data_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/dummy_data_handler/dummy_data_handler.py +97 -0
- mindsdb/integrations/handlers/dummy_data_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/dynamodb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/dynamodb_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/dynamodb_handler/connection_args.py +39 -0
- mindsdb/integrations/handlers/dynamodb_handler/dynamodb_handler.py +293 -0
- mindsdb/integrations/handlers/dynamodb_handler/icon.svg +17 -0
- mindsdb/integrations/handlers/dynamodb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/dynamodb_handler/tests/test_dynamodb_handler.py +34 -0
- mindsdb/integrations/handlers/edgelessdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/edgelessdb_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/edgelessdb_handler/connection_args.py +45 -0
- mindsdb/integrations/handlers/edgelessdb_handler/edgelessdb_handler.py +12 -0
- mindsdb/integrations/handlers/edgelessdb_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/edgelessdb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/edgelessdb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/edgelessdb_handler/tests/test_edgelessdb_handler.py +66 -0
- mindsdb/integrations/handlers/elasticsearch_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/elasticsearch_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/elasticsearch_handler/connection_args.py +38 -0
- mindsdb/integrations/handlers/elasticsearch_handler/elasticsearch_handler.py +288 -0
- mindsdb/integrations/handlers/elasticsearch_handler/icon.svg +16 -0
- mindsdb/integrations/handlers/elasticsearch_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/elasticsearch_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/elasticsearch_handler/tests/test_elasticsearch_handler.py +32 -0
- mindsdb/integrations/handlers/email_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/email_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/email_handler/email_client.py +165 -0
- mindsdb/integrations/handlers/email_handler/email_handler.py +99 -0
- mindsdb/integrations/handlers/email_handler/email_ingestor.py +86 -0
- mindsdb/integrations/handlers/email_handler/email_tables.py +159 -0
- mindsdb/integrations/handlers/email_handler/icon.png +0 -0
- mindsdb/integrations/handlers/email_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/email_handler/settings.py +60 -0
- mindsdb/integrations/handlers/empress_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/empress_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/empress_handler/connection_args.py +42 -0
- mindsdb/integrations/handlers/empress_handler/empress_handler.py +211 -0
- mindsdb/integrations/handlers/empress_handler/icon.png +0 -0
- mindsdb/integrations/handlers/empress_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/empress_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/empress_handler/tests/test_empress_handler.py +55 -0
- mindsdb/integrations/handlers/eventbrite_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/eventbrite_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/eventbrite_handler/eventbrite_handler.py +94 -0
- mindsdb/integrations/handlers/eventbrite_handler/eventbrite_tables.py +612 -0
- mindsdb/integrations/handlers/eventbrite_handler/icon.png +0 -0
- mindsdb/integrations/handlers/eventbrite_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/eventstoredb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/eventstoredb_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/eventstoredb_handler/eventstoredb_handler.py +216 -0
- mindsdb/integrations/handlers/eventstoredb_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/faunadb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/faunadb_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/faunadb_handler/connection_args.py +39 -0
- mindsdb/integrations/handlers/faunadb_handler/faunadb_handler.py +267 -0
- mindsdb/integrations/handlers/faunadb_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/faunadb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/faunadb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/faunadb_handler/tests/test_faunadb_handler.py +41 -0
- mindsdb/integrations/handlers/file_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/file_handler/__init__.py +16 -0
- mindsdb/integrations/handlers/file_handler/file_handler.py +528 -0
- mindsdb/integrations/handlers/file_handler/icon.svg +8 -0
- mindsdb/integrations/handlers/file_handler/requirements.txt +4 -0
- mindsdb/integrations/handlers/file_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/file_handler/tests/data/test.txt +10 -0
- mindsdb/integrations/handlers/file_handler/tests/test_file_handler.py +458 -0
- mindsdb/integrations/handlers/financial_modeling_prep_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/financial_modeling_prep_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/financial_modeling_prep_handler/financial_modeling_handler.py +56 -0
- mindsdb/integrations/handlers/financial_modeling_prep_handler/financial_modeling_tables.py +89 -0
- mindsdb/integrations/handlers/financial_modeling_prep_handler/icon.svg +67 -0
- mindsdb/integrations/handlers/firebird_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/firebird_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/firebird_handler/connection_args.py +34 -0
- mindsdb/integrations/handlers/firebird_handler/firebird_handler.py +240 -0
- mindsdb/integrations/handlers/firebird_handler/icon.svg +16 -0
- mindsdb/integrations/handlers/firebird_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/firebird_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/firebird_handler/tests/test_firebird_handler.py +37 -0
- mindsdb/integrations/handlers/flaml_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/flaml_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/flaml_handler/flaml_handler.py +47 -0
- mindsdb/integrations/handlers/flaml_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/flaml_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/frappe_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/frappe_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/frappe_handler/frappe_client.py +111 -0
- mindsdb/integrations/handlers/frappe_handler/frappe_handler.py +209 -0
- mindsdb/integrations/handlers/frappe_handler/frappe_tables.py +82 -0
- mindsdb/integrations/handlers/frappe_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/frappe_handler/requirements.txt +0 -0
- mindsdb/integrations/handlers/gcs_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/gcs_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/gcs_handler/connection_args.py +29 -0
- mindsdb/integrations/handlers/gcs_handler/gcs_handler.py +375 -0
- mindsdb/integrations/handlers/gcs_handler/gcs_tables.py +50 -0
- mindsdb/integrations/handlers/gcs_handler/icon.svg +1 -0
- mindsdb/integrations/handlers/gcs_handler/requirements.txt +4 -0
- mindsdb/integrations/handlers/github_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/github_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/github_handler/connection_args.py +32 -0
- mindsdb/integrations/handlers/github_handler/github_handler.py +124 -0
- mindsdb/integrations/handlers/github_handler/github_tables.py +965 -0
- mindsdb/integrations/handlers/github_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/github_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/gitlab_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/gitlab_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/gitlab_handler/gitlab_handler.py +84 -0
- mindsdb/integrations/handlers/gitlab_handler/gitlab_tables.py +393 -0
- mindsdb/integrations/handlers/gitlab_handler/icon.svg +6 -0
- mindsdb/integrations/handlers/gitlab_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/gmail_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/gmail_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/gmail_handler/connection_args.py +27 -0
- mindsdb/integrations/handlers/gmail_handler/gmail_handler.py +566 -0
- mindsdb/integrations/handlers/gmail_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/gmail_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/gmail_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/gmail_handler/tests/test_gmail_handler.py +50 -0
- mindsdb/integrations/handlers/gmail_handler/utils.py +45 -0
- mindsdb/integrations/handlers/google_analytics_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/google_analytics_handler/__init__.py +18 -0
- mindsdb/integrations/handlers/google_analytics_handler/google_analytics_handler.py +129 -0
- mindsdb/integrations/handlers/google_analytics_handler/google_analytics_tables.py +283 -0
- mindsdb/integrations/handlers/google_analytics_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/google_analytics_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/google_analytics_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/google_analytics_handler/tests/test_google_analytics_handler.py +48 -0
- mindsdb/integrations/handlers/google_books_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/google_books_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/google_books_handler/google_books_handler.py +184 -0
- mindsdb/integrations/handlers/google_books_handler/google_books_tables.py +185 -0
- mindsdb/integrations/handlers/google_books_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/google_books_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/google_books_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/google_books_handler/tests/test_google_books_handler.py +41 -0
- mindsdb/integrations/handlers/google_calendar_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/google_calendar_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/google_calendar_handler/connection_args.py +12 -0
- mindsdb/integrations/handlers/google_calendar_handler/google_calendar_handler.py +292 -0
- mindsdb/integrations/handlers/google_calendar_handler/google_calendar_tables.py +228 -0
- mindsdb/integrations/handlers/google_calendar_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/google_calendar_handler/requirements.txt +3 -0
- mindsdb/integrations/handlers/google_calendar_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/google_calendar_handler/tests/test_google_calendar_handler.py +56 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/connection_args.py +20 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/google_content_shopping_handler.py +396 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/google_content_shopping_tables.py +435 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/icon.svg +15 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/google_content_shopping_handler/tests/test_google_content_shopping_handler.py +64 -0
- mindsdb/integrations/handlers/google_fit_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/google_fit_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/google_fit_handler/google_fit_handler.py +155 -0
- mindsdb/integrations/handlers/google_fit_handler/google_fit_tables.py +69 -0
- mindsdb/integrations/handlers/google_fit_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/google_fit_handler/requirements.txt +4 -0
- mindsdb/integrations/handlers/google_gemini_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/google_gemini_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/google_gemini_handler/google_gemini_handler.py +370 -0
- mindsdb/integrations/handlers/google_gemini_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/google_gemini_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/google_search_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/google_search_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/google_search_handler/connection_args.py +15 -0
- mindsdb/integrations/handlers/google_search_handler/google_search_handler.py +205 -0
- mindsdb/integrations/handlers/google_search_handler/google_search_tables.py +220 -0
- mindsdb/integrations/handlers/google_search_handler/icon.svg +19 -0
- mindsdb/integrations/handlers/google_search_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/google_search_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/google_search_handler/tests/test_google_search_handler.py +55 -0
- mindsdb/integrations/handlers/greptimedb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/greptimedb_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/greptimedb_handler/greptimedb_handler.py +21 -0
- mindsdb/integrations/handlers/greptimedb_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/greptimedb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/groq_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/groq_handler/__init__.py +23 -0
- mindsdb/integrations/handlers/groq_handler/groq_handler.py +136 -0
- mindsdb/integrations/handlers/groq_handler/icon.svg +30 -0
- mindsdb/integrations/handlers/groq_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/groq_handler/settings.py +31 -0
- mindsdb/integrations/handlers/hackernews_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/hackernews_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/hackernews_handler/hn_handler.py +102 -0
- mindsdb/integrations/handlers/hackernews_handler/hn_table.py +152 -0
- mindsdb/integrations/handlers/hackernews_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/hana_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/hana_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/hana_handler/connection_args.py +57 -0
- mindsdb/integrations/handlers/hana_handler/hana_handler.py +259 -0
- mindsdb/integrations/handlers/hana_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/hana_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/hive_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/hive_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/hive_handler/connection_args.py +53 -0
- mindsdb/integrations/handlers/hive_handler/hive_handler.py +224 -0
- mindsdb/integrations/handlers/hive_handler/icon.svg +41 -0
- mindsdb/integrations/handlers/hive_handler/requirements.txt +3 -0
- mindsdb/integrations/handlers/hive_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/hive_handler/tests/test_hive_handler.py +50 -0
- mindsdb/integrations/handlers/hsqldb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/hsqldb_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/hsqldb_handler/connection_args.py +39 -0
- mindsdb/integrations/handlers/hsqldb_handler/hsqldb_handler.py +197 -0
- mindsdb/integrations/handlers/hsqldb_handler/icon.png +0 -0
- mindsdb/integrations/handlers/hsqldb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/hubspot_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/hubspot_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/hubspot_handler/hubspot_handler.py +96 -0
- mindsdb/integrations/handlers/hubspot_handler/hubspot_tables.py +589 -0
- mindsdb/integrations/handlers/hubspot_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/hubspot_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/huggingface_api_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/huggingface_api_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/huggingface_api_handler/exceptions.py +6 -0
- mindsdb/integrations/handlers/huggingface_api_handler/huggingface_api_handler.py +250 -0
- mindsdb/integrations/handlers/huggingface_api_handler/icon.svg +24 -0
- mindsdb/integrations/handlers/huggingface_api_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/huggingface_api_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/huggingface_api_handler/tests/test_huggingface_api_handler.py +9 -0
- mindsdb/integrations/handlers/huggingface_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/huggingface_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/huggingface_handler/finetune.py +223 -0
- mindsdb/integrations/handlers/huggingface_handler/huggingface_handler.py +383 -0
- mindsdb/integrations/handlers/huggingface_handler/icon.svg +24 -0
- mindsdb/integrations/handlers/huggingface_handler/requirements.txt +5 -0
- mindsdb/integrations/handlers/huggingface_handler/requirements_cpu.txt +6 -0
- mindsdb/integrations/handlers/huggingface_handler/settings.py +27 -0
- mindsdb/integrations/handlers/ibm_cos_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/ibm_cos_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/ibm_cos_handler/connection_args.py +38 -0
- mindsdb/integrations/handlers/ibm_cos_handler/ibm_cos_handler.py +338 -0
- mindsdb/integrations/handlers/ibm_cos_handler/icon.svg +54 -0
- mindsdb/integrations/handlers/ibm_cos_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/ibm_cos_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/ibm_cos_handler/tests/test_ibm_cos_handler.py +23 -0
- mindsdb/integrations/handlers/ignite_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/ignite_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/ignite_handler/connection_args.py +46 -0
- mindsdb/integrations/handlers/ignite_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/ignite_handler/ignite_handler.py +207 -0
- mindsdb/integrations/handlers/ignite_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/ignite_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/ignite_handler/tests/test_ignite_handler.py +33 -0
- mindsdb/integrations/handlers/impala_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/impala_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/impala_handler/connection_args.py +37 -0
- mindsdb/integrations/handlers/impala_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/impala_handler/impala_handler.py +156 -0
- mindsdb/integrations/handlers/impala_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/impala_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/impala_handler/tests/test_impala_handler.py +50 -0
- mindsdb/integrations/handlers/influxdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/influxdb_handler/__init__.py +26 -0
- mindsdb/integrations/handlers/influxdb_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/influxdb_handler/influxdb_handler.py +105 -0
- mindsdb/integrations/handlers/influxdb_handler/influxdb_tables.py +81 -0
- mindsdb/integrations/handlers/influxdb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/informix_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/informix_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/informix_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/informix_handler/informix_handler.py +318 -0
- mindsdb/integrations/handlers/informix_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/informix_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/informix_handler/tests/test_informix_handler.py +52 -0
- mindsdb/integrations/handlers/ingres_handler/__about__.py +10 -0
- mindsdb/integrations/handlers/ingres_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/ingres_handler/connection_args.py +36 -0
- mindsdb/integrations/handlers/ingres_handler/icon.svg +6 -0
- mindsdb/integrations/handlers/ingres_handler/ingres_handler.py +210 -0
- mindsdb/integrations/handlers/ingres_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/ingres_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/ingres_handler/tests/test_ingres_handler.py +53 -0
- mindsdb/integrations/handlers/instatus_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/instatus_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/instatus_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/instatus_handler/instatus_handler.py +127 -0
- mindsdb/integrations/handlers/instatus_handler/instatus_tables.py +393 -0
- mindsdb/integrations/handlers/intercom_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/intercom_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/intercom_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/intercom_handler/intercom_handler.py +117 -0
- mindsdb/integrations/handlers/intercom_handler/intercom_tables.py +152 -0
- mindsdb/integrations/handlers/jira_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/jira_handler/__init__.py +26 -0
- mindsdb/integrations/handlers/jira_handler/icon.svg +15 -0
- mindsdb/integrations/handlers/jira_handler/jira_handler.py +119 -0
- mindsdb/integrations/handlers/jira_handler/jira_table.py +151 -0
- mindsdb/integrations/handlers/jira_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/kinetica_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/kinetica_handler/__init__.py +22 -0
- mindsdb/integrations/handlers/kinetica_handler/connection_args.py +54 -0
- mindsdb/integrations/handlers/kinetica_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/kinetica_handler/kinetica_handler.py +12 -0
- mindsdb/integrations/handlers/lancedb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/lancedb_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/lancedb_handler/connection_args.py +35 -0
- mindsdb/integrations/handlers/lancedb_handler/icon.svg +8 -0
- mindsdb/integrations/handlers/lancedb_handler/lancedb_handler.py +329 -0
- mindsdb/integrations/handlers/lancedb_handler/requirements.txt +3 -0
- mindsdb/integrations/handlers/lancedb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/lancedb_handler/tests/test_lancedb_handler.py +99 -0
- mindsdb/integrations/handlers/langchain_embedding_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/langchain_embedding_handler/__init__.py +23 -0
- mindsdb/integrations/handlers/langchain_embedding_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/langchain_embedding_handler/langchain_embedding_handler.py +221 -0
- mindsdb/integrations/handlers/langchain_embedding_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/langchain_embedding_handler/vllm_embeddings.py +111 -0
- mindsdb/integrations/handlers/langchain_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/langchain_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/langchain_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/langchain_handler/langchain_handler.py +278 -0
- mindsdb/integrations/handlers/langchain_handler/requirements.txt +8 -0
- mindsdb/integrations/handlers/langchain_handler/tools.py +247 -0
- mindsdb/integrations/handlers/leonardoai_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/leonardoai_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/leonardoai_handler/icon.svg +306 -0
- mindsdb/integrations/handlers/leonardoai_handler/leonardo_ai_handler.py +225 -0
- mindsdb/integrations/handlers/leonardoai_handler/requirements.txt +0 -0
- mindsdb/integrations/handlers/libsql_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/libsql_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/libsql_handler/connection_args.py +22 -0
- mindsdb/integrations/handlers/libsql_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/libsql_handler/libsql_handler.py +192 -0
- mindsdb/integrations/handlers/libsql_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/libsql_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/libsql_handler/tests/test_libsql_handler.py +45 -0
- mindsdb/integrations/handlers/lightdash_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/lightdash_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/lightdash_handler/api.py +513 -0
- mindsdb/integrations/handlers/lightdash_handler/icon.png +0 -0
- mindsdb/integrations/handlers/lightdash_handler/lightdash_handler.py +108 -0
- mindsdb/integrations/handlers/lightdash_handler/lightdash_tables.py +648 -0
- mindsdb/integrations/handlers/lightdash_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/lightfm_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/lightfm_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/lightfm_handler/helpers.py +175 -0
- mindsdb/integrations/handlers/lightfm_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/lightfm_handler/lightfm_handler.py +198 -0
- mindsdb/integrations/handlers/lightfm_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/lightfm_handler/settings.py +7 -0
- mindsdb/integrations/handlers/lightwood_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/lightwood_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/lightwood_handler/functions.py +252 -0
- mindsdb/integrations/handlers/lightwood_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/lightwood_handler/lightwood_handler.py +581 -0
- mindsdb/integrations/handlers/lightwood_handler/requirements.txt +4 -0
- mindsdb/integrations/handlers/lightwood_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/lightwood_handler/tests/test_lightwood_handler.py +258 -0
- mindsdb/integrations/handlers/lightwood_handler/utils.py +76 -0
- mindsdb/integrations/handlers/lindorm_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/lindorm_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/lindorm_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/lindorm_handler/lindorm_handler.py +220 -0
- mindsdb/integrations/handlers/lindorm_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/lindorm_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/lindorm_handler/tests/test_lindorm_handler.py +33 -0
- mindsdb/integrations/handlers/litellm_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/litellm_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/litellm_handler/icon.png +0 -0
- mindsdb/integrations/handlers/litellm_handler/litellm_handler.py +141 -0
- mindsdb/integrations/handlers/litellm_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/litellm_handler/settings.py +39 -0
- mindsdb/integrations/handlers/llama_index_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/llama_index_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/llama_index_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/llama_index_handler/llama_index_handler.py +201 -0
- mindsdb/integrations/handlers/llama_index_handler/requirements.txt +5 -0
- mindsdb/integrations/handlers/llama_index_handler/settings.py +65 -0
- mindsdb/integrations/handlers/ludwig_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/ludwig_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/ludwig_handler/functions.py +0 -0
- mindsdb/integrations/handlers/ludwig_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/ludwig_handler/ludwig_handler.py +68 -0
- mindsdb/integrations/handlers/ludwig_handler/requirements.txt +3 -0
- mindsdb/integrations/handlers/ludwig_handler/utils.py +12 -0
- mindsdb/integrations/handlers/luma_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/luma_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/luma_handler/connection_args.py +18 -0
- mindsdb/integrations/handlers/luma_handler/icon.png +0 -0
- mindsdb/integrations/handlers/luma_handler/luma.py +47 -0
- mindsdb/integrations/handlers/luma_handler/luma_handler.py +77 -0
- mindsdb/integrations/handlers/luma_handler/luma_tables.py +164 -0
- mindsdb/integrations/handlers/luma_handler/requirements.txt +0 -0
- mindsdb/integrations/handlers/mariadb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/mariadb_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/mariadb_handler/connection_args.py +76 -0
- mindsdb/integrations/handlers/mariadb_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/mariadb_handler/mariadb_handler.py +12 -0
- mindsdb/integrations/handlers/mariadb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/materialize_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/materialize_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/materialize_handler/icon.svg +7 -0
- mindsdb/integrations/handlers/materialize_handler/materialize_handler.py +43 -0
- mindsdb/integrations/handlers/materialize_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/materialize_handler/tests/test_materialize_handler.py +56 -0
- mindsdb/integrations/handlers/matrixone_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/matrixone_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/matrixone_handler/connection_args.py +52 -0
- mindsdb/integrations/handlers/matrixone_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/matrixone_handler/matrixone_handler.py +168 -0
- mindsdb/integrations/handlers/matrixone_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/matrixone_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/matrixone_handler/tests/test_matrixone_handler.py +56 -0
- mindsdb/integrations/handlers/maxdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/maxdb_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/maxdb_handler/connection_args.py +42 -0
- mindsdb/integrations/handlers/maxdb_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/maxdb_handler/maxdb_handler.py +185 -0
- mindsdb/integrations/handlers/maxdb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/maxdb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/maxdb_handler/tests/test_maxdb_handler.py +55 -0
- mindsdb/integrations/handlers/mediawiki_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/mediawiki_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/mediawiki_handler/icon.svg +153 -0
- mindsdb/integrations/handlers/mediawiki_handler/mediawiki_handler.py +87 -0
- mindsdb/integrations/handlers/mediawiki_handler/mediawiki_tables.py +98 -0
- mindsdb/integrations/handlers/mediawiki_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/mendeley_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/mendeley_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/mendeley_handler/icon.svg +14 -0
- mindsdb/integrations/handlers/mendeley_handler/mendeley_handler.py +225 -0
- mindsdb/integrations/handlers/mendeley_handler/mendeley_tables.py +134 -0
- mindsdb/integrations/handlers/mendeley_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/mendeley_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/mendeley_handler/tests/test_mendeley_handler.py +108 -0
- mindsdb/integrations/handlers/merlion_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/merlion_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/merlion_handler/adapters.py +182 -0
- mindsdb/integrations/handlers/merlion_handler/icon.svg +16 -0
- mindsdb/integrations/handlers/merlion_handler/merlion_handler.py +205 -0
- mindsdb/integrations/handlers/merlion_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/milvus_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/milvus_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/milvus_handler/connection_args.py +112 -0
- mindsdb/integrations/handlers/milvus_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/milvus_handler/milvus_handler.py +332 -0
- mindsdb/integrations/handlers/milvus_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/milvus_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/minds_endpoint_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/minds_endpoint_handler/__init__.py +23 -0
- mindsdb/integrations/handlers/minds_endpoint_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/minds_endpoint_handler/minds_endpoint_handler.py +132 -0
- mindsdb/integrations/handlers/minds_endpoint_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/minds_endpoint_handler/settings.py +18 -0
- mindsdb/integrations/handlers/minds_endpoint_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/minds_endpoint_handler/tests/test_minds_endpoint_handler.py +160 -0
- mindsdb/integrations/handlers/mlflow_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/mlflow_handler/__init__.py +18 -0
- mindsdb/integrations/handlers/mlflow_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/mlflow_handler/mlflow_handler.py +83 -0
- mindsdb/integrations/handlers/mlflow_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/monetdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/monetdb_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/monetdb_handler/connection_args.py +44 -0
- mindsdb/integrations/handlers/monetdb_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/monetdb_handler/monetdb_handler.py +219 -0
- mindsdb/integrations/handlers/monetdb_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/monetdb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/monetdb_handler/tests/test_monetdb_handler.py +50 -0
- mindsdb/integrations/handlers/monetdb_handler/utils/__init__.py +0 -0
- mindsdb/integrations/handlers/monetdb_handler/utils/monet_get_id.py +50 -0
- mindsdb/integrations/handlers/mongodb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/mongodb_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/mongodb_handler/connection_args.py +46 -0
- mindsdb/integrations/handlers/mongodb_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/mongodb_handler/mongodb_handler.py +372 -0
- mindsdb/integrations/handlers/mongodb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/mongodb_handler/tests/test_mongodb_handler.py +125 -0
- mindsdb/integrations/handlers/mongodb_handler/utils/__init__.py +0 -0
- mindsdb/integrations/handlers/mongodb_handler/utils/mongodb_render.py +286 -0
- mindsdb/integrations/handlers/monkeylearn_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/monkeylearn_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/monkeylearn_handler/icon.png +0 -0
- mindsdb/integrations/handlers/monkeylearn_handler/monkeylearn_handler.py +81 -0
- mindsdb/integrations/handlers/monkeylearn_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/ms_one_drive_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/ms_one_drive_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/ms_one_drive_handler/icon.svg +31 -0
- mindsdb/integrations/handlers/ms_one_drive_handler/ms_graph_api_one_drive_client.py +102 -0
- mindsdb/integrations/handlers/ms_one_drive_handler/ms_one_drive_handler.py +252 -0
- mindsdb/integrations/handlers/ms_one_drive_handler/ms_one_drive_tables.py +100 -0
- mindsdb/integrations/handlers/ms_teams_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/ms_teams_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/ms_teams_handler/icon.svg +23 -0
- mindsdb/integrations/handlers/ms_teams_handler/ms_teams_handler.py +193 -0
- mindsdb/integrations/handlers/ms_teams_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/mssql_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/mssql_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/mssql_handler/connection_args.py +52 -0
- mindsdb/integrations/handlers/mssql_handler/icon.svg +21 -0
- mindsdb/integrations/handlers/mssql_handler/mssql_handler.py +218 -0
- mindsdb/integrations/handlers/mssql_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/mssql_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/mssql_handler/tests/test_mssql_handler.py +169 -0
- mindsdb/integrations/handlers/mysql_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/mysql_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/mysql_handler/connection_args.py +76 -0
- mindsdb/integrations/handlers/mysql_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/mysql_handler/mysql_handler.py +214 -0
- mindsdb/integrations/handlers/mysql_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/mysql_handler/settings.py +46 -0
- mindsdb/integrations/handlers/neuralforecast_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/neuralforecast_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/neuralforecast_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/neuralforecast_handler/neuralforecast_handler.py +135 -0
- mindsdb/integrations/handlers/neuralforecast_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/neuralforecast_handler/requirements_extra.txt +2 -0
- mindsdb/integrations/handlers/newsapi_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/newsapi_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/newsapi_handler/connection_args.py +14 -0
- mindsdb/integrations/handlers/newsapi_handler/icon.png +0 -0
- mindsdb/integrations/handlers/newsapi_handler/newsapi_handler.py +209 -0
- mindsdb/integrations/handlers/newsapi_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/newsapi_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/newsapi_handler/tests/test_newsapi_handler.py +90 -0
- mindsdb/integrations/handlers/notion_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/notion_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/notion_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/notion_handler/notion_handler.py +238 -0
- mindsdb/integrations/handlers/notion_handler/notion_table.py +422 -0
- mindsdb/integrations/handlers/notion_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/notion_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/notion_handler/tests/test_notion_handler.py +62 -0
- mindsdb/integrations/handlers/npm_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/npm_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/npm_handler/api.py +26 -0
- mindsdb/integrations/handlers/npm_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/npm_handler/npm_handler.py +53 -0
- mindsdb/integrations/handlers/npm_handler/npm_tables.py +242 -0
- mindsdb/integrations/handlers/npm_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/nuo_jdbc_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/nuo_jdbc_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/nuo_jdbc_handler/connection_args.py +65 -0
- mindsdb/integrations/handlers/nuo_jdbc_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/nuo_jdbc_handler/nuo_jdbc_handler.py +228 -0
- mindsdb/integrations/handlers/nuo_jdbc_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/nuo_jdbc_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/nuo_jdbc_handler/tests/test_nuo_handler.py +50 -0
- mindsdb/integrations/handlers/oceanbase_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/oceanbase_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/oceanbase_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/oceanbase_handler/oceanbase_handler.py +48 -0
- mindsdb/integrations/handlers/oceanbase_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/oceanbase_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/oceanbase_handler/tests/test_oceanbase_handler.py +56 -0
- mindsdb/integrations/handlers/oilpriceapi_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/oilpriceapi_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/oilpriceapi_handler/connection_args.py +18 -0
- mindsdb/integrations/handlers/oilpriceapi_handler/icon.svg +7 -0
- mindsdb/integrations/handlers/oilpriceapi_handler/oilpriceapi.py +45 -0
- mindsdb/integrations/handlers/oilpriceapi_handler/oilpriceapi_handler.py +100 -0
- mindsdb/integrations/handlers/oilpriceapi_handler/oilpriceapi_tables.py +208 -0
- mindsdb/integrations/handlers/ollama_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/ollama_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/ollama_handler/icon.png +0 -0
- mindsdb/integrations/handlers/ollama_handler/ollama_handler.py +171 -0
- mindsdb/integrations/handlers/openai_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/openai_handler/__init__.py +22 -0
- mindsdb/integrations/handlers/openai_handler/constants.py +36 -0
- mindsdb/integrations/handlers/openai_handler/creation_args.py +14 -0
- mindsdb/integrations/handlers/openai_handler/helpers.py +197 -0
- mindsdb/integrations/handlers/openai_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/openai_handler/model_using_args.py +5 -0
- mindsdb/integrations/handlers/openai_handler/openai_handler.py +1188 -0
- mindsdb/integrations/handlers/openai_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/openai_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/openai_handler/tests/test_openai_handler.py +509 -0
- mindsdb/integrations/handlers/openbb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/openbb_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/openbb_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/openbb_handler/openbb_handler.py +119 -0
- mindsdb/integrations/handlers/openbb_handler/openbb_tables.py +337 -0
- mindsdb/integrations/handlers/openbb_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/opengauss_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/opengauss_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/opengauss_handler/connection_args.py +36 -0
- mindsdb/integrations/handlers/opengauss_handler/icon.svg +6 -0
- mindsdb/integrations/handlers/opengauss_handler/opengauss_handler.py +11 -0
- mindsdb/integrations/handlers/opengauss_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/opengauss_handler/tests/test_opengauss_handler.py +45 -0
- mindsdb/integrations/handlers/openstreetmap_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/openstreetmap_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/openstreetmap_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/openstreetmap_handler/openstreetmap_handler.py +90 -0
- mindsdb/integrations/handlers/openstreetmap_handler/openstreetmap_tables.py +243 -0
- mindsdb/integrations/handlers/openstreetmap_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/openstreetmap_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/openstreetmap_handler/tests/test_openstreetmap_handler.py +37 -0
- mindsdb/integrations/handlers/oracle_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/oracle_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/oracle_handler/connection_args.py +70 -0
- mindsdb/integrations/handlers/oracle_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/oracle_handler/oracle_handler.py +246 -0
- mindsdb/integrations/handlers/oracle_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/oracle_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/oracle_handler/tests/test_oracle_handler.py +32 -0
- mindsdb/integrations/handlers/orioledb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/orioledb_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/orioledb_handler/connection_args.py +36 -0
- mindsdb/integrations/handlers/orioledb_handler/icon.svg +6 -0
- mindsdb/integrations/handlers/orioledb_handler/orioledb_handler.py +11 -0
- mindsdb/integrations/handlers/orioledb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/orioledb_handler/tests/test_orioledb_handler.py +56 -0
- mindsdb/integrations/handlers/palm_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/palm_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/palm_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/palm_handler/palm_handler.py +448 -0
- mindsdb/integrations/handlers/palm_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/paypal_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/paypal_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/paypal_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/paypal_handler/paypal_handler.py +145 -0
- mindsdb/integrations/handlers/paypal_handler/paypal_tables.py +283 -0
- mindsdb/integrations/handlers/paypal_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/pgvector_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/pgvector_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/pgvector_handler/connection_args.py +54 -0
- mindsdb/integrations/handlers/pgvector_handler/icon.svg +23 -0
- mindsdb/integrations/handlers/pgvector_handler/pgvector_handler.py +447 -0
- mindsdb/integrations/handlers/pgvector_handler/requirements.txt +0 -0
- mindsdb/integrations/handlers/phoenix_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/phoenix_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/phoenix_handler/connection_args.py +50 -0
- mindsdb/integrations/handlers/phoenix_handler/icon.png +0 -0
- mindsdb/integrations/handlers/phoenix_handler/phoenix_handler.py +229 -0
- mindsdb/integrations/handlers/phoenix_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/phoenix_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/phoenix_handler/tests/test_phoenix_handler.py +33 -0
- mindsdb/integrations/handlers/pinecone_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/pinecone_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/pinecone_handler/connection_args.py +53 -0
- mindsdb/integrations/handlers/pinecone_handler/icon.svg +21 -0
- mindsdb/integrations/handlers/pinecone_handler/pinecone_handler.py +304 -0
- mindsdb/integrations/handlers/pinecone_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/pinecone_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/pinot_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/pinot_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/pinot_handler/connection_args.py +49 -0
- mindsdb/integrations/handlers/pinot_handler/icon.svg +7 -0
- mindsdb/integrations/handlers/pinot_handler/pinot_handler.py +223 -0
- mindsdb/integrations/handlers/pinot_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/pinot_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/pinot_handler/tests/test_pinot_handler.py +36 -0
- mindsdb/integrations/handlers/pirateweather_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/pirateweather_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/pirateweather_handler/connection_args.py +14 -0
- mindsdb/integrations/handlers/pirateweather_handler/icon.png +0 -0
- mindsdb/integrations/handlers/pirateweather_handler/pirateweather_handler.py +236 -0
- mindsdb/integrations/handlers/plaid_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/plaid_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/plaid_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/plaid_handler/plaid_handler.py +225 -0
- mindsdb/integrations/handlers/plaid_handler/plaid_tables.py +159 -0
- mindsdb/integrations/handlers/plaid_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/plaid_handler/utils.py +9 -0
- mindsdb/integrations/handlers/planetscale_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/planetscale_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/planetscale_handler/connection_args.py +36 -0
- mindsdb/integrations/handlers/planetscale_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/planetscale_handler/planetscale_handler.py +14 -0
- mindsdb/integrations/handlers/planetscale_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/popularity_recommender_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/popularity_recommender_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/popularity_recommender_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/popularity_recommender_handler/popularity_recommender_handler.py +103 -0
- mindsdb/integrations/handlers/popularity_recommender_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/portkey_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/portkey_handler/__init__.py +22 -0
- mindsdb/integrations/handlers/portkey_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/portkey_handler/portkey_handler.py +79 -0
- mindsdb/integrations/handlers/portkey_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/postgres_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/postgres_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/postgres_handler/connection_args.py +65 -0
- mindsdb/integrations/handlers/postgres_handler/icon.svg +23 -0
- mindsdb/integrations/handlers/postgres_handler/postgres_handler.py +396 -0
- mindsdb/integrations/handlers/postgres_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/postgres_handler/tests/test_postgres_handler.py +172 -0
- mindsdb/integrations/handlers/pycaret_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/pycaret_handler/__init__.py +22 -0
- mindsdb/integrations/handlers/pycaret_handler/icon.png +0 -0
- mindsdb/integrations/handlers/pycaret_handler/pycaret_handler.py +116 -0
- mindsdb/integrations/handlers/pycaret_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/pycaret_handler/test/__init__.py +0 -0
- mindsdb/integrations/handlers/pycaret_handler/test/test_pycaret.py +242 -0
- mindsdb/integrations/handlers/pypi_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/pypi_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/pypi_handler/api.py +152 -0
- mindsdb/integrations/handlers/pypi_handler/icon.svg +123 -0
- mindsdb/integrations/handlers/pypi_handler/pypi_handler.py +73 -0
- mindsdb/integrations/handlers/pypi_handler/pypi_tables.py +263 -0
- mindsdb/integrations/handlers/qdrant_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/qdrant_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/qdrant_handler/connection_args.py +75 -0
- mindsdb/integrations/handlers/qdrant_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/qdrant_handler/qdrant_handler.py +402 -0
- mindsdb/integrations/handlers/qdrant_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/questdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/questdb_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/questdb_handler/icon.svg +25 -0
- mindsdb/integrations/handlers/questdb_handler/questdb_handler.py +72 -0
- mindsdb/integrations/handlers/questdb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/questdb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/questdb_handler/tests/test_questdb_handler.py +35 -0
- mindsdb/integrations/handlers/quickbooks_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/quickbooks_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/quickbooks_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/quickbooks_handler/quickbooks_handler.py +97 -0
- mindsdb/integrations/handlers/quickbooks_handler/quickbooks_table.py +374 -0
- mindsdb/integrations/handlers/quickbooks_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/rag_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/rag_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/rag_handler/exceptions.py +26 -0
- mindsdb/integrations/handlers/rag_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/rag_handler/ingest.py +185 -0
- mindsdb/integrations/handlers/rag_handler/rag.py +147 -0
- mindsdb/integrations/handlers/rag_handler/rag_handler.py +144 -0
- mindsdb/integrations/handlers/rag_handler/requirements.txt +6 -0
- mindsdb/integrations/handlers/rag_handler/settings.py +479 -0
- mindsdb/integrations/handlers/ray_serve_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/ray_serve_handler/__init__.py +18 -0
- mindsdb/integrations/handlers/ray_serve_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/ray_serve_handler/ray_serve_handler.py +66 -0
- mindsdb/integrations/handlers/reddit_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/reddit_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/reddit_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/reddit_handler/reddit_handler.py +106 -0
- mindsdb/integrations/handlers/reddit_handler/reddit_tables.py +195 -0
- mindsdb/integrations/handlers/reddit_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/redshift_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/redshift_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/redshift_handler/connection_args.py +58 -0
- mindsdb/integrations/handlers/redshift_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/redshift_handler/redshift_handler.py +69 -0
- mindsdb/integrations/handlers/redshift_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/redshift_handler/tests/test_redshift_handler.py +154 -0
- mindsdb/integrations/handlers/replicate_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/replicate_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/replicate_handler/assets/Arjuna.png +0 -0
- mindsdb/integrations/handlers/replicate_handler/assets/groot.png +0 -0
- mindsdb/integrations/handlers/replicate_handler/assets/warrior.png +0 -0
- mindsdb/integrations/handlers/replicate_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/replicate_handler/replicate_handler.py +162 -0
- mindsdb/integrations/handlers/replicate_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/rocket_chat_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/rocket_chat_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/rocket_chat_handler/icon.svg +6 -0
- mindsdb/integrations/handlers/rocket_chat_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/rocket_chat_handler/rocket_chat_handler.py +153 -0
- mindsdb/integrations/handlers/rocket_chat_handler/rocket_chat_tables.py +201 -0
- mindsdb/integrations/handlers/rockset_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/rockset_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/rockset_handler/connection_args.py +45 -0
- mindsdb/integrations/handlers/rockset_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/rockset_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/rockset_handler/rockset_handler.py +11 -0
- mindsdb/integrations/handlers/rockset_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/rockset_handler/tests/test.png +0 -0
- mindsdb/integrations/handlers/rockset_handler/tests/test2.png +0 -0
- mindsdb/integrations/handlers/rockset_handler/tests/test_rockset_handler.py +32 -0
- mindsdb/integrations/handlers/s3_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/s3_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/s3_handler/connection_args.py +47 -0
- mindsdb/integrations/handlers/s3_handler/icon.svg +15 -0
- mindsdb/integrations/handlers/s3_handler/s3_handler.py +454 -0
- mindsdb/integrations/handlers/s3_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/s3_handler/tests/test_s3_handler.py +37 -0
- mindsdb/integrations/handlers/salesforce_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/salesforce_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/salesforce_handler/connection_args.py +39 -0
- mindsdb/integrations/handlers/salesforce_handler/icon.svg +1 -0
- mindsdb/integrations/handlers/salesforce_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/salesforce_handler/salesforce_handler.py +180 -0
- mindsdb/integrations/handlers/salesforce_handler/salesforce_tables.py +129 -0
- mindsdb/integrations/handlers/sap_erp_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/sap_erp_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/sap_erp_handler/api.py +79 -0
- mindsdb/integrations/handlers/sap_erp_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/sap_erp_handler/sap_erp_handler.py +161 -0
- mindsdb/integrations/handlers/sap_erp_handler/sap_erp_tables.py +1928 -0
- mindsdb/integrations/handlers/sap_erp_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/scylla_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/scylla_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/scylla_handler/connection_args.py +50 -0
- mindsdb/integrations/handlers/scylla_handler/icon.svg +17 -0
- mindsdb/integrations/handlers/scylla_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/scylla_handler/scylla_handler.py +205 -0
- mindsdb/integrations/handlers/scylla_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/scylla_handler/tests/test_scylla_handler.py +38 -0
- mindsdb/integrations/handlers/sendinblue_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/sendinblue_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/sendinblue_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/sendinblue_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/sendinblue_handler/sendinblue_handler.py +94 -0
- mindsdb/integrations/handlers/sendinblue_handler/sendinblue_tables.py +276 -0
- mindsdb/integrations/handlers/sentence_transformers_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/sentence_transformers_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/sentence_transformers_handler/icon.svg +21 -0
- mindsdb/integrations/handlers/sentence_transformers_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/sentence_transformers_handler/sentence_transformers_handler.py +75 -0
- mindsdb/integrations/handlers/sentence_transformers_handler/settings.py +12 -0
- mindsdb/integrations/handlers/serpstack_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/serpstack_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/serpstack_handler/icon.svg +86 -0
- mindsdb/integrations/handlers/serpstack_handler/serpstack_handler.py +123 -0
- mindsdb/integrations/handlers/serpstack_handler/serpstack_tables.py +260 -0
- mindsdb/integrations/handlers/sharepoint_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/sharepoint_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/sharepoint_handler/icon.svg +23 -0
- mindsdb/integrations/handlers/sharepoint_handler/sharepoint_api.py +579 -0
- mindsdb/integrations/handlers/sharepoint_handler/sharepoint_handler.py +147 -0
- mindsdb/integrations/handlers/sharepoint_handler/sharepoint_tables.py +581 -0
- mindsdb/integrations/handlers/sharepoint_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/sharepoint_handler/tests/test_sharepoint_handler.py +53 -0
- mindsdb/integrations/handlers/sharepoint_handler/utils.py +163 -0
- mindsdb/integrations/handlers/sheets_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/sheets_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/sheets_handler/connection_args.py +20 -0
- mindsdb/integrations/handlers/sheets_handler/icon.svg +55 -0
- mindsdb/integrations/handlers/sheets_handler/sheets_handler.py +176 -0
- mindsdb/integrations/handlers/sheets_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/sheets_handler/tests/test_sheets_handler.py +33 -0
- mindsdb/integrations/handlers/shopify_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/shopify_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/shopify_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/shopify_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/shopify_handler/shopify_handler.py +143 -0
- mindsdb/integrations/handlers/shopify_handler/shopify_tables.py +1083 -0
- mindsdb/integrations/handlers/singlestore_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/singlestore_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/singlestore_handler/icon.svg +16 -0
- mindsdb/integrations/handlers/singlestore_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/singlestore_handler/singlestore_handler.py +12 -0
- mindsdb/integrations/handlers/singlestore_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/singlestore_handler/tests/test_singlestore_handler.py +42 -0
- mindsdb/integrations/handlers/slack_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/slack_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/slack_handler/connection_args.py +26 -0
- mindsdb/integrations/handlers/slack_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/slack_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/slack_handler/slack_handler.py +339 -0
- mindsdb/integrations/handlers/slack_handler/slack_tables.py +718 -0
- mindsdb/integrations/handlers/slack_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/slack_handler/tests/test_slack.py +27 -0
- mindsdb/integrations/handlers/snowflake_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/snowflake_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/snowflake_handler/connection_args.py +63 -0
- mindsdb/integrations/handlers/snowflake_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/snowflake_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/snowflake_handler/snowflake_handler.py +280 -0
- mindsdb/integrations/handlers/snowflake_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/snowflake_handler/tests/test_snowflake_handler.py +230 -0
- mindsdb/integrations/handlers/solace_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/solace_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/solace_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/solace_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/solace_handler/solace_handler.py +169 -0
- mindsdb/integrations/handlers/solr_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/solr_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/solr_handler/connection_args.py +46 -0
- mindsdb/integrations/handlers/solr_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/solr_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/solr_handler/solr_handler.py +176 -0
- mindsdb/integrations/handlers/solr_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/solr_handler/tests/test_solr_handler.py +38 -0
- mindsdb/integrations/handlers/spacy_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/spacy_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/spacy_handler/icon.svg +3 -0
- mindsdb/integrations/handlers/spacy_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/spacy_handler/spacy_handler.py +194 -0
- mindsdb/integrations/handlers/sqlany_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/sqlany_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/sqlany_handler/connection_args.py +46 -0
- mindsdb/integrations/handlers/sqlany_handler/icon.svg +13 -0
- mindsdb/integrations/handlers/sqlany_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/sqlany_handler/sqlany_handler.py +179 -0
- mindsdb/integrations/handlers/sqlite_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/sqlite_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/sqlite_handler/connection_args.py +16 -0
- mindsdb/integrations/handlers/sqlite_handler/icon.svg +12 -0
- mindsdb/integrations/handlers/sqlite_handler/sqlite_handler.py +184 -0
- mindsdb/integrations/handlers/sqlite_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/sqlite_handler/tests/test_sqlite_handler.py +32 -0
- mindsdb/integrations/handlers/sqreamdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/sqreamdb_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/sqreamdb_handler/connection_args.py +48 -0
- mindsdb/integrations/handlers/sqreamdb_handler/icon.svg +21 -0
- mindsdb/integrations/handlers/sqreamdb_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/sqreamdb_handler/sqreamdb_handler.py +154 -0
- mindsdb/integrations/handlers/sqreamdb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/sqreamdb_handler/tests/test_sqreamdb_handler.py +45 -0
- mindsdb/integrations/handlers/stabilityai_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/stabilityai_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/stabilityai_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/stabilityai_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/stabilityai_handler/stabilityai.py +186 -0
- mindsdb/integrations/handlers/stabilityai_handler/stabilityai_handler.py +172 -0
- mindsdb/integrations/handlers/starrocks_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/starrocks_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/starrocks_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/starrocks_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/starrocks_handler/starrocks_handler.py +48 -0
- mindsdb/integrations/handlers/starrocks_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/starrocks_handler/tests/test_starrocks_handler.py +56 -0
- mindsdb/integrations/handlers/statsforecast_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/statsforecast_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/statsforecast_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/statsforecast_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/statsforecast_handler/requirements_extra.txt +1 -0
- mindsdb/integrations/handlers/statsforecast_handler/statsforecast_handler.py +192 -0
- mindsdb/integrations/handlers/strapi_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/strapi_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/strapi_handler/icon.svg +7 -0
- mindsdb/integrations/handlers/strapi_handler/strapi_handler.py +153 -0
- mindsdb/integrations/handlers/strapi_handler/strapi_tables.py +131 -0
- mindsdb/integrations/handlers/strapi_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/strapi_handler/tests/test_strapi_handler.py +51 -0
- mindsdb/integrations/handlers/strava_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/strava_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/strava_handler/icon.svg +12 -0
- mindsdb/integrations/handlers/strava_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/strava_handler/strava_handler.py +113 -0
- mindsdb/integrations/handlers/strava_handler/strava_tables.py +247 -0
- mindsdb/integrations/handlers/stripe_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/stripe_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/stripe_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/stripe_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/stripe_handler/stripe_handler.py +102 -0
- mindsdb/integrations/handlers/stripe_handler/stripe_tables.py +508 -0
- mindsdb/integrations/handlers/supabase_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/supabase_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/supabase_handler/icon.svg +15 -0
- mindsdb/integrations/handlers/supabase_handler/supabase_handler.py +11 -0
- mindsdb/integrations/handlers/supabase_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/supabase_handler/tests/test_supabase_handler.py +46 -0
- mindsdb/integrations/handlers/surrealdb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/surrealdb_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/surrealdb_handler/connection_args.py +52 -0
- mindsdb/integrations/handlers/surrealdb_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/surrealdb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/surrealdb_handler/surrealdb_handler.py +196 -0
- mindsdb/integrations/handlers/surrealdb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/surrealdb_handler/tests/test_surrealdb_handler.py +57 -0
- mindsdb/integrations/handlers/surrealdb_handler/utils/__init__.py +0 -0
- mindsdb/integrations/handlers/surrealdb_handler/utils/surreal_get_info.py +20 -0
- mindsdb/integrations/handlers/symbl_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/symbl_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/symbl_handler/connection_args.py +25 -0
- mindsdb/integrations/handlers/symbl_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/symbl_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/symbl_handler/symbl_handler.py +106 -0
- mindsdb/integrations/handlers/symbl_handler/symbl_tables.py +648 -0
- mindsdb/integrations/handlers/tdengine_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/tdengine_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/tdengine_handler/connection_args.py +36 -0
- mindsdb/integrations/handlers/tdengine_handler/icon.svg +59 -0
- mindsdb/integrations/handlers/tdengine_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/tdengine_handler/tdengine_handler.py +146 -0
- mindsdb/integrations/handlers/tdengine_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/tdengine_handler/tests/test_tdengine_handler.py +48 -0
- mindsdb/integrations/handlers/teradata_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/teradata_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/teradata_handler/connection_args.py +39 -0
- mindsdb/integrations/handlers/teradata_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/teradata_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/teradata_handler/teradata_handler.py +245 -0
- mindsdb/integrations/handlers/tidb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/tidb_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/tidb_handler/connection_args.py +36 -0
- mindsdb/integrations/handlers/tidb_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/tidb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/tidb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/tidb_handler/tests/test_tidb_handler.py +45 -0
- mindsdb/integrations/handlers/tidb_handler/tidb_handler.py +11 -0
- mindsdb/integrations/handlers/timegpt_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/timegpt_handler/__init__.py +18 -0
- mindsdb/integrations/handlers/timegpt_handler/icon.svg +5 -0
- mindsdb/integrations/handlers/timegpt_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/timegpt_handler/timegpt_handler.py +205 -0
- mindsdb/integrations/handlers/timescaledb_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/timescaledb_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/timescaledb_handler/icon.svg +9 -0
- mindsdb/integrations/handlers/timescaledb_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/timescaledb_handler/tests/test_timescaledb_handler.py +47 -0
- mindsdb/integrations/handlers/timescaledb_handler/timescaledb_handler.py +46 -0
- mindsdb/integrations/handlers/tpot_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/tpot_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/tpot_handler/icon.png +0 -0
- mindsdb/integrations/handlers/tpot_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/tpot_handler/tpot_handler.py +80 -0
- mindsdb/integrations/handlers/trino_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/trino_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/trino_handler/icon.svg +23 -0
- mindsdb/integrations/handlers/trino_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/trino_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/trino_handler/tests/test_trino_handler.py +48 -0
- mindsdb/integrations/handlers/trino_handler/trino_config_provider.py +12 -0
- mindsdb/integrations/handlers/trino_handler/trino_handler.py +182 -0
- mindsdb/integrations/handlers/tripadvisor_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/tripadvisor_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/tripadvisor_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/tripadvisor_handler/tripadvisor_api.py +215 -0
- mindsdb/integrations/handlers/tripadvisor_handler/tripadvisor_handler.py +275 -0
- mindsdb/integrations/handlers/tripadvisor_handler/tripadvisor_table.py +477 -0
- mindsdb/integrations/handlers/twelve_labs_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/twelve_labs_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/twelve_labs_handler/icon.svg +7 -0
- mindsdb/integrations/handlers/twelve_labs_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/twelve_labs_handler/settings.py +271 -0
- mindsdb/integrations/handlers/twelve_labs_handler/twelve_labs_api_client.py +567 -0
- mindsdb/integrations/handlers/twelve_labs_handler/twelve_labs_handler.py +285 -0
- mindsdb/integrations/handlers/twilio_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/twilio_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/twilio_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/twilio_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/twilio_handler/twilio_handler.py +385 -0
- mindsdb/integrations/handlers/twitter_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/twitter_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/twitter_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/twitter_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/twitter_handler/twitter_handler.py +471 -0
- mindsdb/integrations/handlers/unify_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/unify_handler/__init__.py +22 -0
- mindsdb/integrations/handlers/unify_handler/creation_args.py +14 -0
- mindsdb/integrations/handlers/unify_handler/icon.svg +25 -0
- mindsdb/integrations/handlers/unify_handler/model_using_args.py +5 -0
- mindsdb/integrations/handlers/unify_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/unify_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/unify_handler/tests/test_unify_handler.py +60 -0
- mindsdb/integrations/handlers/unify_handler/unify_handler.py +67 -0
- mindsdb/integrations/handlers/vertex_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/vertex_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/vertex_handler/icon.png +0 -0
- mindsdb/integrations/handlers/vertex_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/vertex_handler/vertex_client.py +95 -0
- mindsdb/integrations/handlers/vertex_handler/vertex_handler.py +87 -0
- mindsdb/integrations/handlers/vertica_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/vertica_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/vertica_handler/connection_args.py +41 -0
- mindsdb/integrations/handlers/vertica_handler/icon.svg +8 -0
- mindsdb/integrations/handlers/vertica_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/vertica_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/vertica_handler/tests/test_vertica_handler.py +53 -0
- mindsdb/integrations/handlers/vertica_handler/vertica_handler.py +160 -0
- mindsdb/integrations/handlers/vitess_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/vitess_handler/__init__.py +20 -0
- mindsdb/integrations/handlers/vitess_handler/icon.svg +23 -0
- mindsdb/integrations/handlers/vitess_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/vitess_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/vitess_handler/tests/test_vitess_handler.py +56 -0
- mindsdb/integrations/handlers/vitess_handler/vitess_handler.py +48 -0
- mindsdb/integrations/handlers/weaviate_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/weaviate_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/weaviate_handler/connection_args.py +29 -0
- mindsdb/integrations/handlers/weaviate_handler/icon.svg +197 -0
- mindsdb/integrations/handlers/weaviate_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/weaviate_handler/weaviate_handler.py +652 -0
- mindsdb/integrations/handlers/web_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/web_handler/__init__.py +24 -0
- mindsdb/integrations/handlers/web_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/web_handler/requirements.txt +3 -0
- mindsdb/integrations/handlers/web_handler/urlcrawl_helpers.py +343 -0
- mindsdb/integrations/handlers/web_handler/web_handler.py +91 -0
- mindsdb/integrations/handlers/webz_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/webz_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/webz_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/webz_handler/requirements.txt +3 -0
- mindsdb/integrations/handlers/webz_handler/webz_handler.py +175 -0
- mindsdb/integrations/handlers/webz_handler/webz_tables.py +218 -0
- mindsdb/integrations/handlers/whatsapp_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/whatsapp_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/whatsapp_handler/icon.svg +19 -0
- mindsdb/integrations/handlers/whatsapp_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/whatsapp_handler/whatsapp_handler.py +420 -0
- mindsdb/integrations/handlers/writer_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/writer_handler/__init__.py +30 -0
- mindsdb/integrations/handlers/writer_handler/evaluate.py +362 -0
- mindsdb/integrations/handlers/writer_handler/icon.svg +10 -0
- mindsdb/integrations/handlers/writer_handler/ingest.py +11 -0
- mindsdb/integrations/handlers/writer_handler/rag.py +14 -0
- mindsdb/integrations/handlers/writer_handler/requirements.txt +4 -0
- mindsdb/integrations/handlers/writer_handler/settings.py +86 -0
- mindsdb/integrations/handlers/writer_handler/writer_handler.py +188 -0
- mindsdb/integrations/handlers/xata_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/xata_handler/__init__.py +29 -0
- mindsdb/integrations/handlers/xata_handler/connection_args.py +35 -0
- mindsdb/integrations/handlers/xata_handler/icon.svg +29 -0
- mindsdb/integrations/handlers/xata_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/xata_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/xata_handler/xata_handler.py +347 -0
- mindsdb/integrations/handlers/youtube_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/youtube_handler/__init__.py +27 -0
- mindsdb/integrations/handlers/youtube_handler/icon.svg +11 -0
- mindsdb/integrations/handlers/youtube_handler/requirements.txt +2 -0
- mindsdb/integrations/handlers/youtube_handler/youtube_handler.py +164 -0
- mindsdb/integrations/handlers/youtube_handler/youtube_tables.py +448 -0
- mindsdb/integrations/handlers/yugabyte_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/yugabyte_handler/__init__.py +19 -0
- mindsdb/integrations/handlers/yugabyte_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/yugabyte_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/yugabyte_handler/tests/test_yugabyte_handler.py +49 -0
- mindsdb/integrations/handlers/yugabyte_handler/yugabyte_handler.py +60 -0
- mindsdb/integrations/handlers/zendesk_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/zendesk_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/zendesk_handler/connection_args.py +33 -0
- mindsdb/integrations/handlers/zendesk_handler/icon.svg +1 -0
- mindsdb/integrations/handlers/zendesk_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/zendesk_handler/zendesk_handler.py +89 -0
- mindsdb/integrations/handlers/zendesk_handler/zendesk_tables.py +463 -0
- mindsdb/integrations/handlers/zipcodebase_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/zipcodebase_handler/__init__.py +28 -0
- mindsdb/integrations/handlers/zipcodebase_handler/connection_args.py +18 -0
- mindsdb/integrations/handlers/zipcodebase_handler/icon.svg +4 -0
- mindsdb/integrations/handlers/zipcodebase_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/zipcodebase_handler/zipcodebase.py +67 -0
- mindsdb/integrations/handlers/zipcodebase_handler/zipcodebase_handler.py +107 -0
- mindsdb/integrations/handlers/zipcodebase_handler/zipcodebase_tables.py +499 -0
- mindsdb/integrations/handlers/zotero_handler/__about__.py +9 -0
- mindsdb/integrations/handlers/zotero_handler/__init__.py +21 -0
- mindsdb/integrations/handlers/zotero_handler/icon.svg +102 -0
- mindsdb/integrations/handlers/zotero_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/zotero_handler/zotero_handler.py +109 -0
- mindsdb/integrations/handlers/zotero_handler/zotero_tables.py +157 -0
- mindsdb/integrations/libs/__init__.py +3 -0
- mindsdb/integrations/libs/api_handler.py +436 -0
- mindsdb/integrations/libs/api_handler_exceptions.py +18 -0
- mindsdb/integrations/libs/base.py +355 -0
- mindsdb/integrations/libs/const.py +23 -0
- mindsdb/integrations/libs/llm/__init__.py +0 -0
- mindsdb/integrations/libs/llm/config.py +106 -0
- mindsdb/integrations/libs/llm/utils.py +603 -0
- mindsdb/integrations/libs/ml_exec_base.py +453 -0
- mindsdb/integrations/libs/ml_handler_process/__init__.py +8 -0
- mindsdb/integrations/libs/ml_handler_process/create_engine_process.py +28 -0
- mindsdb/integrations/libs/ml_handler_process/create_validation_process.py +14 -0
- mindsdb/integrations/libs/ml_handler_process/describe_process.py +117 -0
- mindsdb/integrations/libs/ml_handler_process/func_call_process.py +26 -0
- mindsdb/integrations/libs/ml_handler_process/handlers_cacher.py +28 -0
- mindsdb/integrations/libs/ml_handler_process/learn_process.py +156 -0
- mindsdb/integrations/libs/ml_handler_process/predict_process.py +35 -0
- mindsdb/integrations/libs/ml_handler_process/update_engine_process.py +28 -0
- mindsdb/integrations/libs/ml_handler_process/update_process.py +27 -0
- mindsdb/integrations/libs/process_cache.py +430 -0
- mindsdb/integrations/libs/realtime_chat_handler.py +33 -0
- mindsdb/integrations/libs/response.py +95 -0
- mindsdb/integrations/libs/storage_handler.py +88 -0
- mindsdb/integrations/libs/vectordatabase_handler.py +534 -0
- mindsdb/integrations/utilities/__init__.py +0 -0
- mindsdb/integrations/utilities/datasets/__init__.py +0 -0
- mindsdb/integrations/utilities/datasets/dataset.py +73 -0
- mindsdb/integrations/utilities/datasets/question_answering/fda_style_qa.csv +21 -0
- mindsdb/integrations/utilities/datasets/question_answering/squad_v2_val_100_sample.csv +106 -0
- mindsdb/integrations/utilities/date_utils.py +79 -0
- mindsdb/integrations/utilities/handler_utils.py +70 -0
- mindsdb/integrations/utilities/handlers/__init__.py +0 -0
- mindsdb/integrations/utilities/handlers/api_utilities/__init__.py +1 -0
- mindsdb/integrations/utilities/handlers/api_utilities/microsoft/__init__.py +1 -0
- mindsdb/integrations/utilities/handlers/api_utilities/microsoft/ms_graph_api_utilities.py +138 -0
- mindsdb/integrations/utilities/handlers/auth_utilities/__init__.py +2 -0
- mindsdb/integrations/utilities/handlers/auth_utilities/exceptions.py +11 -0
- mindsdb/integrations/utilities/handlers/auth_utilities/google/__init__.py +2 -0
- mindsdb/integrations/utilities/handlers/auth_utilities/google/google_service_account_oauth_utilities.py +59 -0
- mindsdb/integrations/utilities/handlers/auth_utilities/google/google_user_oauth_utilities.py +108 -0
- mindsdb/integrations/utilities/handlers/auth_utilities/microsoft/__init__.py +1 -0
- mindsdb/integrations/utilities/handlers/auth_utilities/microsoft/ms_graph_api_auth_utilities.py +128 -0
- mindsdb/integrations/utilities/handlers/query_utilities/__init__.py +4 -0
- mindsdb/integrations/utilities/handlers/query_utilities/base_query_utilities.py +63 -0
- mindsdb/integrations/utilities/handlers/query_utilities/delete_query_utilities.py +44 -0
- mindsdb/integrations/utilities/handlers/query_utilities/exceptions.py +17 -0
- mindsdb/integrations/utilities/handlers/query_utilities/insert_query_utilities.py +71 -0
- mindsdb/integrations/utilities/handlers/query_utilities/select_query_utilities.py +134 -0
- mindsdb/integrations/utilities/handlers/query_utilities/update_query_utilities.py +67 -0
- mindsdb/integrations/utilities/handlers/validation_utilities/__init__.py +1 -0
- mindsdb/integrations/utilities/handlers/validation_utilities/parameter_validation_utilities.py +18 -0
- mindsdb/integrations/utilities/install.py +134 -0
- mindsdb/integrations/utilities/query_traversal.py +239 -0
- mindsdb/integrations/utilities/rag/__init__.py +0 -0
- mindsdb/integrations/utilities/rag/chains/__init__.py +0 -0
- mindsdb/integrations/utilities/rag/chains/map_reduce_summarizer_chain.py +218 -0
- mindsdb/integrations/utilities/rag/config_loader.py +77 -0
- mindsdb/integrations/utilities/rag/loaders/__init__.py +0 -0
- mindsdb/integrations/utilities/rag/loaders/file_loader.py +44 -0
- mindsdb/integrations/utilities/rag/loaders/vector_store_loader/MDBVectorStore.py +54 -0
- mindsdb/integrations/utilities/rag/loaders/vector_store_loader/__init__.py +0 -0
- mindsdb/integrations/utilities/rag/loaders/vector_store_loader/pgvector.py +84 -0
- mindsdb/integrations/utilities/rag/loaders/vector_store_loader/vector_store_loader.py +60 -0
- mindsdb/integrations/utilities/rag/pipelines/__init__.py +0 -0
- mindsdb/integrations/utilities/rag/pipelines/rag.py +253 -0
- mindsdb/integrations/utilities/rag/rag_pipeline_builder.py +83 -0
- mindsdb/integrations/utilities/rag/rerankers/__init__.py +0 -0
- mindsdb/integrations/utilities/rag/rerankers/reranker_compressor.py +156 -0
- mindsdb/integrations/utilities/rag/retrievers/__init__.py +0 -0
- mindsdb/integrations/utilities/rag/retrievers/auto_retriever.py +117 -0
- mindsdb/integrations/utilities/rag/retrievers/base.py +10 -0
- mindsdb/integrations/utilities/rag/retrievers/multi_vector_retriever.py +101 -0
- mindsdb/integrations/utilities/rag/retrievers/sql_retriever.py +149 -0
- mindsdb/integrations/utilities/rag/settings.py +511 -0
- mindsdb/integrations/utilities/rag/splitters/__init__.py +0 -0
- mindsdb/integrations/utilities/rag/splitters/file_splitter.py +132 -0
- mindsdb/integrations/utilities/rag/utils.py +52 -0
- mindsdb/integrations/utilities/rag/vector_store.py +99 -0
- mindsdb/integrations/utilities/sql_utils.py +224 -0
- mindsdb/integrations/utilities/test_utils.py +30 -0
- mindsdb/integrations/utilities/time_series_utils.py +191 -0
- mindsdb/integrations/utilities/utils.py +32 -0
- mindsdb/interfaces/__init__.py +1 -0
- mindsdb/interfaces/agents/__init__.py +0 -0
- mindsdb/interfaces/agents/agents_controller.py +435 -0
- mindsdb/interfaces/agents/callback_handlers.py +130 -0
- mindsdb/interfaces/agents/constants.py +179 -0
- mindsdb/interfaces/agents/langchain_agent.py +676 -0
- mindsdb/interfaces/agents/langfuse_callback_handler.py +163 -0
- mindsdb/interfaces/agents/mindsdb_chat_model.py +196 -0
- mindsdb/interfaces/agents/mindsdb_database_agent.py +54 -0
- mindsdb/interfaces/agents/safe_output_parser.py +51 -0
- mindsdb/interfaces/chatbot/__init__.py +1 -0
- mindsdb/interfaces/chatbot/chatbot_controller.py +409 -0
- mindsdb/interfaces/chatbot/chatbot_executor.py +226 -0
- mindsdb/interfaces/chatbot/chatbot_task.py +174 -0
- mindsdb/interfaces/chatbot/memory.py +223 -0
- mindsdb/interfaces/chatbot/model_executor.py +107 -0
- mindsdb/interfaces/chatbot/polling.py +233 -0
- mindsdb/interfaces/chatbot/types.py +38 -0
- mindsdb/interfaces/database/__init__.py +0 -0
- mindsdb/interfaces/database/database.py +122 -0
- mindsdb/interfaces/database/integrations.py +931 -0
- mindsdb/interfaces/database/log.py +297 -0
- mindsdb/interfaces/database/projects.py +397 -0
- mindsdb/interfaces/database/views.py +139 -0
- mindsdb/interfaces/file/__init__.py +0 -0
- mindsdb/interfaces/file/file_controller.py +146 -0
- mindsdb/interfaces/functions/__init__.py +0 -0
- mindsdb/interfaces/functions/controller.py +207 -0
- mindsdb/interfaces/jobs/__init__.py +0 -0
- mindsdb/interfaces/jobs/jobs_controller.py +549 -0
- mindsdb/interfaces/jobs/scheduler.py +143 -0
- mindsdb/interfaces/knowledge_base/__init__.py +0 -0
- mindsdb/interfaces/knowledge_base/controller.py +899 -0
- mindsdb/interfaces/knowledge_base/preprocessing/__init__.py +0 -0
- mindsdb/interfaces/knowledge_base/preprocessing/constants.py +13 -0
- mindsdb/interfaces/knowledge_base/preprocessing/document_loader.py +176 -0
- mindsdb/interfaces/knowledge_base/preprocessing/document_preprocessor.py +401 -0
- mindsdb/interfaces/knowledge_base/preprocessing/models.py +108 -0
- mindsdb/interfaces/model/__init__.py +0 -0
- mindsdb/interfaces/model/functions.py +155 -0
- mindsdb/interfaces/model/model_controller.py +488 -0
- mindsdb/interfaces/query_context/__init__.py +0 -0
- mindsdb/interfaces/query_context/context_controller.py +289 -0
- mindsdb/interfaces/query_context/last_query.py +266 -0
- mindsdb/interfaces/skills/__init__.py +1 -0
- mindsdb/interfaces/skills/custom/__init__.py +0 -0
- mindsdb/interfaces/skills/custom/text2sql/__init__.py +0 -0
- mindsdb/interfaces/skills/custom/text2sql/mindsdb_sql_tool.py +37 -0
- mindsdb/interfaces/skills/custom/text2sql/mindsdb_sql_toolkit.py +88 -0
- mindsdb/interfaces/skills/retrieval_tool.py +110 -0
- mindsdb/interfaces/skills/skill_tool.py +255 -0
- mindsdb/interfaces/skills/skills_controller.py +175 -0
- mindsdb/interfaces/skills/sql_agent.py +256 -0
- mindsdb/interfaces/storage/__init__.py +1 -0
- mindsdb/interfaces/storage/db.py +597 -0
- mindsdb/interfaces/storage/fs.py +631 -0
- mindsdb/interfaces/storage/json.py +97 -0
- mindsdb/interfaces/storage/model_fs.py +282 -0
- mindsdb/interfaces/tabs/__init__.py +0 -0
- mindsdb/interfaces/tabs/tabs_controller.py +291 -0
- mindsdb/interfaces/tasks/__init__.py +0 -0
- mindsdb/interfaces/tasks/task.py +16 -0
- mindsdb/interfaces/tasks/task_monitor.py +150 -0
- mindsdb/interfaces/tasks/task_thread.py +55 -0
- mindsdb/interfaces/triggers/__init__.py +0 -0
- mindsdb/interfaces/triggers/trigger_task.py +95 -0
- mindsdb/interfaces/triggers/triggers_controller.py +167 -0
- mindsdb/metrics/__init__.py +0 -0
- mindsdb/metrics/metrics.py +50 -0
- mindsdb/metrics/server.py +26 -0
- mindsdb/migrations/__init__.py +0 -0
- mindsdb/migrations/alembic.ini +65 -0
- mindsdb/migrations/env.py +87 -0
- mindsdb/migrations/migrate.py +53 -0
- mindsdb/migrations/versions/2021-11-30_17c3d2384711_init.py +178 -0
- mindsdb/migrations/versions/2022-01-26_47f97b83cee4_views.py +38 -0
- mindsdb/migrations/versions/2022-02-09_27c5aca9e47e_db_files.py +256 -0
- mindsdb/migrations/versions/2022-05-25_d74c189b87e6_predictor_integration.py +156 -0
- mindsdb/migrations/versions/2022-07-08_999bceb904df_integration_args.py +106 -0
- mindsdb/migrations/versions/2022-07-15_b5b53e0ea7f8_training_data_rows_columns_count.py +29 -0
- mindsdb/migrations/versions/2022-07-22_6e834843e7e9_training_time.py +33 -0
- mindsdb/migrations/versions/2022-08-19_976f15a37e6a_predictors_versioning.py +42 -0
- mindsdb/migrations/versions/2022-08-25_6a54ba55872e_view_integration.py +36 -0
- mindsdb/migrations/versions/2022-08-29_473e8f239481_straighten.py +81 -0
- mindsdb/migrations/versions/2022-09-06_96d5fef10caa_data_integration_id.py +69 -0
- mindsdb/migrations/versions/2022-09-08_87b2df2b83e1_predictor_status.py +74 -0
- mindsdb/migrations/versions/2022-09-19_3d5e70105df7_content_storage.py +59 -0
- mindsdb/migrations/versions/2022-09-29_cada7d2be947_json_storage.py +90 -0
- mindsdb/migrations/versions/2022-10-14_43c52d23845a_projects.py +115 -0
- mindsdb/migrations/versions/2022-11-07_1e60096fc817_predictor_version.py +66 -0
- mindsdb/migrations/versions/2022-11-11_d429095b570f_data_integration_id.py +106 -0
- mindsdb/migrations/versions/2022-12-26_459218b0844c_fix_unique_constraint.py +34 -0
- mindsdb/migrations/versions/2023-02-02_b6d0a47294ac_jobs.py +56 -0
- mindsdb/migrations/versions/2023-02-17_ee63d868fa84_predictor_integration_null.py +42 -0
- mindsdb/migrations/versions/2023-02-25_3154382dab17_training_progress.py +36 -0
- mindsdb/migrations/versions/2023-02-27_ef04cdbe51ed_jobs_user_class.py +33 -0
- mindsdb/migrations/versions/2023-04-11_b8be148dbc85_jobs_history_query.py +35 -0
- mindsdb/migrations/versions/2023-05-24_6d748f2c7b0b_remove_streams.py +46 -0
- mindsdb/migrations/versions/2023-05-31_aaecd7012a78_chatbot.py +41 -0
- mindsdb/migrations/versions/2023-06-16_9d6271bb2c38_update_chat_bots_table.py +28 -0
- mindsdb/migrations/versions/2023-06-19_b5bf593ba659_create_chat_bots_history_table.py +35 -0
- mindsdb/migrations/versions/2023-06-27_607709e1615b_update_project_names.py +60 -0
- mindsdb/migrations/versions/2023-07-13_a57506731839_triggers.py +54 -0
- mindsdb/migrations/versions/2023-07-19_ad04ee0bd385_chatbot_to_task.py +38 -0
- mindsdb/migrations/versions/2023-08-29_b0382f5be48d_predictor_hostname.py +26 -0
- mindsdb/migrations/versions/2023-08-31_4c26ad04eeaa_add_skills_table.py +32 -0
- mindsdb/migrations/versions/2023-09-06_d44ab65a6a35_add_agents_table.py +35 -0
- mindsdb/migrations/versions/2023-09-06_e187961e844a_add_agent_skills_table.py +29 -0
- mindsdb/migrations/versions/2023-09-18_011e6f2dd9c2_backfill_agent_id.py +82 -0
- mindsdb/migrations/versions/2023-09-18_f16d4ab03091_add_agent_id.py +28 -0
- mindsdb/migrations/versions/2023-09-20_309db3d07cf4_add_knowledge_base.py +54 -0
- mindsdb/migrations/versions/2023-10-03_6cb02dfd7f61_query_context.py +38 -0
- mindsdb/migrations/versions/2023-11-01_c67822e96833_jobs_active.py +33 -0
- mindsdb/migrations/versions/2023-12-25_4b3c9d63e89c_predictor_index.py +44 -0
- mindsdb/migrations/versions/2024-02-02_5a5c49313e52_job_condition.py +32 -0
- mindsdb/migrations/versions/2024-02-12_9461892bd889_llm_log.py +44 -0
- mindsdb/migrations/versions/2024-04-25_2958416fbe75_drop_semaphor.py +36 -0
- mindsdb/migrations/versions/2024-06-06_cbedc4968d5d_store_llm_data.py +34 -0
- mindsdb/migrations/versions/2024-07-09_bfc6f44f5bc9_agent_model_optional.py +50 -0
- mindsdb/migrations/versions/2024-07-19_45eb2eb61f70_add_provider_to_agent.py +47 -0
- mindsdb/migrations/versions/2024-08-12_8e17ff6b75e9_agents_deleted_at.py +42 -0
- mindsdb/migrations/versions/2024-10-07_6c57ed39a82b_added_webhook_token_to_chat_bots.py +27 -0
- mindsdb/migrations/versions/2024-11-15_9d559f68d535_add_llm_log_columns.py +41 -0
- mindsdb/migrations/versions/2024-11-19_0f89b523f346_agent_skills_parameters.py +28 -0
- mindsdb/migrations/versions/2024-11-28_a8a3fac369e7_llm_log_json_in_out.py +103 -0
- mindsdb/migrations/versions/2024-11-29_f6dc924079fa_predictor_training_metadata.py +44 -0
- mindsdb/migrations/versions/__init__.py +0 -0
- mindsdb/utilities/__init__.py +0 -0
- mindsdb/utilities/auth.py +73 -0
- mindsdb/utilities/cache.py +282 -0
- mindsdb/utilities/config.py +530 -0
- mindsdb/utilities/context.py +57 -0
- mindsdb/utilities/context_executor.py +59 -0
- mindsdb/utilities/exception.py +29 -0
- mindsdb/utilities/fs.py +153 -0
- mindsdb/utilities/functions.py +197 -0
- mindsdb/utilities/hooks/__init__.py +34 -0
- mindsdb/utilities/hooks/profiling.py +74 -0
- mindsdb/utilities/json_encoder.py +33 -0
- mindsdb/utilities/log.py +97 -0
- mindsdb/utilities/log_controller.py +39 -0
- mindsdb/utilities/ml_task_queue/__init__.py +57 -0
- mindsdb/utilities/ml_task_queue/base.py +14 -0
- mindsdb/utilities/ml_task_queue/const.py +26 -0
- mindsdb/utilities/ml_task_queue/consumer.py +252 -0
- mindsdb/utilities/ml_task_queue/producer.py +81 -0
- mindsdb/utilities/ml_task_queue/task.py +82 -0
- mindsdb/utilities/ml_task_queue/utils.py +124 -0
- mindsdb/utilities/otel.py +72 -0
- mindsdb/utilities/profiler/__init__.py +19 -0
- mindsdb/utilities/profiler/profiler.py +144 -0
- mindsdb/utilities/ps.py +78 -0
- mindsdb/utilities/render/__init__.py +0 -0
- mindsdb/utilities/render/sqlalchemy_render.py +831 -0
- mindsdb/utilities/security.py +54 -0
- mindsdb/utilities/sentry.py +46 -0
- mindsdb/utilities/telemetry.py +44 -0
- mindsdb/utilities/wizards.py +49 -0
- MindsDB-1.2.9.dist-info/LICENSE +0 -21
- MindsDB-1.2.9.dist-info/METADATA +0 -111
- MindsDB-1.2.9.dist-info/RECORD +0 -55
- mindsdb/config/__init__.py +0 -32
- mindsdb/config/helpers.py +0 -21
- mindsdb/external_libs/stats.py +0 -61
- mindsdb/libs/__init__.py +0 -6
- mindsdb/libs/backends/lightwood.py +0 -113
- mindsdb/libs/backends/ludwig.py +0 -507
- mindsdb/libs/constants/mindsdb.py +0 -81
- mindsdb/libs/controllers/predictor.py +0 -592
- mindsdb/libs/controllers/transaction.py +0 -254
- mindsdb/libs/data_sources/file_ds.py +0 -196
- mindsdb/libs/data_types/data_source.py +0 -59
- mindsdb/libs/data_types/mindsdb_logger.py +0 -127
- mindsdb/libs/data_types/probability_evaluation.py +0 -56
- mindsdb/libs/data_types/transaction_data.py +0 -15
- mindsdb/libs/data_types/transaction_output_data.py +0 -29
- mindsdb/libs/data_types/transaction_output_row.py +0 -35
- mindsdb/libs/helpers/explain_prediction.py +0 -114
- mindsdb/libs/helpers/file_helpers.py +0 -66
- mindsdb/libs/helpers/general_helpers.py +0 -276
- mindsdb/libs/helpers/multi_data_source.py +0 -28
- mindsdb/libs/helpers/parser.py +0 -161
- mindsdb/libs/helpers/probabilistic_validator.py +0 -198
- mindsdb/libs/helpers/sqlite_helpers.py +0 -33
- mindsdb/libs/helpers/text_helpers.py +0 -79
- mindsdb/libs/helpers/train_helpers.py +0 -4
- mindsdb/libs/phases/base_module.py +0 -62
- mindsdb/libs/phases/data_extractor/data_extractor.py +0 -233
- mindsdb/libs/phases/data_transformer/data_transformer.py +0 -103
- mindsdb/libs/phases/model_analyzer/helpers/column_evaluator.py +0 -120
- mindsdb/libs/phases/model_analyzer/model_analyzer.py +0 -119
- mindsdb/libs/phases/model_interface/model_interface.py +0 -33
- mindsdb/libs/phases/stats_generator/scores.py +0 -377
- mindsdb/libs/phases/stats_generator/stats_generator.py +0 -694
- mindsdb/scraps.py +0 -133
- {MindsDB-1.2.9.dist-info → MindsDB-24.12.4.0.dist-info}/top_level.txt +0 -0
- /mindsdb/{external_libs → api}/__init__.py +0 -0
- /mindsdb/{libs/backends → api/common}/__init__.py +0 -0
- /mindsdb/{libs/constants → api/executor/data_types}/__init__.py +0 -0
- /mindsdb/{libs/controllers → api/executor/datahub/classes}/__init__.py +0 -0
- /mindsdb/{libs/data_sources → api/executor/sql_query}/__init__.py +0 -0
- /mindsdb/{libs/data_types → api/executor/utilities}/__init__.py +0 -0
- /mindsdb/{libs/helpers → api/http}/__init__.py +0 -0
- /mindsdb/{libs/phases → api/http/namespaces}/__init__.py +0 -0
- /mindsdb/{libs/phases/data_extractor → api/http/namespaces/configs}/__init__.py +0 -0
- /mindsdb/{libs/phases/data_transformer → api/mongo}/__init__.py +0 -0
- /mindsdb/{libs/phases/model_analyzer → api/mongo/utilities}/__init__.py +0 -0
- /mindsdb/{libs/phases/model_analyzer/helpers → api/mysql}/__init__.py +0 -0
- /mindsdb/{libs/phases/model_interface → api/mysql/mysql_proxy}/__init__.py +0 -0
- /mindsdb/{libs/phases/stats_generator → api/mysql/mysql_proxy/classes}/__init__.py +0 -0
|
@@ -0,0 +1,2047 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from textwrap import dedent
|
|
4
|
+
from typing import Optional
|
|
5
|
+
from functools import reduce
|
|
6
|
+
|
|
7
|
+
import pandas as pd
|
|
8
|
+
from mindsdb_evaluator.accuracy.general import evaluate_accuracy
|
|
9
|
+
from mindsdb_sql_parser import parse_sql
|
|
10
|
+
from mindsdb_sql_parser.ast import (
|
|
11
|
+
Alter,
|
|
12
|
+
ASTNode,
|
|
13
|
+
BinaryOperation,
|
|
14
|
+
CommitTransaction,
|
|
15
|
+
Constant,
|
|
16
|
+
CreateTable,
|
|
17
|
+
Delete,
|
|
18
|
+
Describe,
|
|
19
|
+
DropDatabase,
|
|
20
|
+
DropTables,
|
|
21
|
+
DropView,
|
|
22
|
+
Explain,
|
|
23
|
+
Function,
|
|
24
|
+
Identifier,
|
|
25
|
+
Insert,
|
|
26
|
+
NativeQuery,
|
|
27
|
+
Operation,
|
|
28
|
+
RollbackTransaction,
|
|
29
|
+
Select,
|
|
30
|
+
Set,
|
|
31
|
+
Show,
|
|
32
|
+
Star,
|
|
33
|
+
StartTransaction,
|
|
34
|
+
Union,
|
|
35
|
+
Update,
|
|
36
|
+
Use,
|
|
37
|
+
Variable,
|
|
38
|
+
Tuple,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# typed models
|
|
42
|
+
from mindsdb_sql_parser.ast.mindsdb import (
|
|
43
|
+
CreateAgent,
|
|
44
|
+
CreateAnomalyDetectionModel,
|
|
45
|
+
CreateChatBot,
|
|
46
|
+
CreateDatabase,
|
|
47
|
+
CreateJob,
|
|
48
|
+
CreateKnowledgeBase,
|
|
49
|
+
CreateMLEngine,
|
|
50
|
+
CreatePredictor,
|
|
51
|
+
CreateSkill,
|
|
52
|
+
CreateTrigger,
|
|
53
|
+
CreateView,
|
|
54
|
+
DropAgent,
|
|
55
|
+
DropChatBot,
|
|
56
|
+
DropDatasource,
|
|
57
|
+
DropJob,
|
|
58
|
+
DropKnowledgeBase,
|
|
59
|
+
DropMLEngine,
|
|
60
|
+
DropPredictor,
|
|
61
|
+
DropSkill,
|
|
62
|
+
DropTrigger,
|
|
63
|
+
Evaluate,
|
|
64
|
+
FinetunePredictor,
|
|
65
|
+
RetrainPredictor,
|
|
66
|
+
UpdateAgent,
|
|
67
|
+
UpdateChatBot,
|
|
68
|
+
UpdateSkill
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
import mindsdb.utilities.profiler as profiler
|
|
72
|
+
|
|
73
|
+
from mindsdb.integrations.utilities.query_traversal import query_traversal
|
|
74
|
+
from mindsdb.api.executor import Column, SQLQuery, ResultSet
|
|
75
|
+
from mindsdb.api.executor.data_types.answer import ExecuteAnswer
|
|
76
|
+
from mindsdb.api.mysql.mysql_proxy.libs.constants.mysql import (
|
|
77
|
+
CHARSET_NUMBERS,
|
|
78
|
+
SERVER_VARIABLES,
|
|
79
|
+
TYPES,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
from .exceptions import (
|
|
83
|
+
ExecutorException,
|
|
84
|
+
BadDbError,
|
|
85
|
+
NotSupportedYet,
|
|
86
|
+
WrongArgumentError,
|
|
87
|
+
TableNotExistError,
|
|
88
|
+
)
|
|
89
|
+
from mindsdb.api.executor.utilities.functions import download_file
|
|
90
|
+
from mindsdb.api.executor.utilities.sql import query_df
|
|
91
|
+
from mindsdb.integrations.libs.const import (
|
|
92
|
+
HANDLER_CONNECTION_ARG_TYPE,
|
|
93
|
+
PREDICTOR_STATUS,
|
|
94
|
+
)
|
|
95
|
+
from mindsdb.integrations.libs.response import HandlerStatusResponse
|
|
96
|
+
from mindsdb.interfaces.chatbot.chatbot_controller import ChatBotController
|
|
97
|
+
from mindsdb.interfaces.database.projects import ProjectController
|
|
98
|
+
from mindsdb.interfaces.jobs.jobs_controller import JobsController
|
|
99
|
+
from mindsdb.interfaces.model.functions import (
|
|
100
|
+
get_model_record,
|
|
101
|
+
get_model_records,
|
|
102
|
+
get_predictor_integration,
|
|
103
|
+
)
|
|
104
|
+
from mindsdb.interfaces.query_context.context_controller import query_context_controller
|
|
105
|
+
from mindsdb.interfaces.triggers.triggers_controller import TriggersController
|
|
106
|
+
from mindsdb.utilities.context import context as ctx
|
|
107
|
+
from mindsdb.utilities.functions import mark_process, resolve_model_identifier, get_handler_install_message
|
|
108
|
+
from mindsdb.utilities.exception import EntityExistsError, EntityNotExistsError
|
|
109
|
+
from mindsdb.utilities import log
|
|
110
|
+
from mindsdb.api.mysql.mysql_proxy.utilities import ErParseError
|
|
111
|
+
|
|
112
|
+
logger = log.getLogger(__name__)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def _get_show_where(
|
|
116
|
+
statement: ASTNode,
|
|
117
|
+
from_name: Optional[str] = None,
|
|
118
|
+
like_name: Optional[str] = None,
|
|
119
|
+
initial: Optional[ASTNode] = None,
|
|
120
|
+
) -> ASTNode:
|
|
121
|
+
"""combine all possible show filters to single 'where' condition
|
|
122
|
+
SHOW category [FROM name] [LIKE filter] [WHERE filter]
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
statement (ASTNode): 'show' query statement
|
|
126
|
+
from_name (str): name of column for 'from' filter
|
|
127
|
+
like_name (str): name of column for 'like' filter,
|
|
128
|
+
initial (ASTNode): initial 'where' filter
|
|
129
|
+
Returns:
|
|
130
|
+
ASTNode: 'where' statemnt
|
|
131
|
+
"""
|
|
132
|
+
where = []
|
|
133
|
+
if initial is not None:
|
|
134
|
+
where.append(initial)
|
|
135
|
+
if statement.from_table is not None and from_name is not None:
|
|
136
|
+
where.append(
|
|
137
|
+
BinaryOperation(
|
|
138
|
+
"=",
|
|
139
|
+
args=[Identifier(from_name), Constant(statement.from_table.parts[-1])],
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
if statement.like is not None and like_name is not None:
|
|
143
|
+
where.append(
|
|
144
|
+
BinaryOperation(
|
|
145
|
+
"like", args=[Identifier(like_name), Constant(statement.like)]
|
|
146
|
+
)
|
|
147
|
+
)
|
|
148
|
+
if statement.where is not None:
|
|
149
|
+
where.append(statement.where)
|
|
150
|
+
|
|
151
|
+
if len(where) > 0:
|
|
152
|
+
return reduce(
|
|
153
|
+
lambda prev, next: BinaryOperation("and", args=[prev, next]), where
|
|
154
|
+
)
|
|
155
|
+
return None
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class ExecuteCommands:
|
|
159
|
+
def __init__(self, session, context=None):
|
|
160
|
+
if context is None:
|
|
161
|
+
context = {}
|
|
162
|
+
|
|
163
|
+
self.context = context
|
|
164
|
+
self.session = session
|
|
165
|
+
|
|
166
|
+
self.charset_text_type = CHARSET_NUMBERS["utf8_general_ci"]
|
|
167
|
+
self.datahub = session.datahub
|
|
168
|
+
|
|
169
|
+
@profiler.profile()
|
|
170
|
+
def execute_command(self, statement, database_name: str = None) -> ExecuteAnswer:
|
|
171
|
+
sql = None
|
|
172
|
+
if isinstance(statement, ASTNode):
|
|
173
|
+
sql = statement.to_string()
|
|
174
|
+
sql_lower = sql.lower()
|
|
175
|
+
|
|
176
|
+
if database_name is None:
|
|
177
|
+
database_name = self.session.database
|
|
178
|
+
|
|
179
|
+
if type(statement) is CreateDatabase:
|
|
180
|
+
return self.answer_create_database(statement)
|
|
181
|
+
elif type(statement) is CreateMLEngine:
|
|
182
|
+
name = statement.name.parts[-1]
|
|
183
|
+
|
|
184
|
+
return self.answer_create_ml_engine(
|
|
185
|
+
name,
|
|
186
|
+
handler=statement.handler,
|
|
187
|
+
params=statement.params,
|
|
188
|
+
if_not_exists=getattr(statement, "if_not_exists", False)
|
|
189
|
+
)
|
|
190
|
+
elif type(statement) is DropMLEngine:
|
|
191
|
+
return self.answer_drop_ml_engine(statement)
|
|
192
|
+
elif type(statement) is DropPredictor:
|
|
193
|
+
return self.answer_drop_model(statement, database_name)
|
|
194
|
+
|
|
195
|
+
elif type(statement) is DropTables:
|
|
196
|
+
return self.answer_drop_tables(statement, database_name)
|
|
197
|
+
elif type(statement) is DropDatasource or type(statement) is DropDatabase:
|
|
198
|
+
return self.answer_drop_database(statement)
|
|
199
|
+
elif type(statement) is Describe:
|
|
200
|
+
# NOTE in sql 'describe table' is same as 'show columns'
|
|
201
|
+
obj_type = statement.type
|
|
202
|
+
|
|
203
|
+
if obj_type is None or obj_type.upper() in ('MODEL', 'PREDICTOR'):
|
|
204
|
+
return self.answer_describe_predictor(statement.value, database_name)
|
|
205
|
+
else:
|
|
206
|
+
return self.answer_describe_object(obj_type.upper(), statement.value, database_name)
|
|
207
|
+
|
|
208
|
+
elif type(statement) is RetrainPredictor:
|
|
209
|
+
return self.answer_retrain_predictor(statement, database_name)
|
|
210
|
+
elif type(statement) is FinetunePredictor:
|
|
211
|
+
return self.answer_finetune_predictor(statement, database_name)
|
|
212
|
+
elif type(statement) is Show:
|
|
213
|
+
sql_category = statement.category.lower()
|
|
214
|
+
if hasattr(statement, "modes"):
|
|
215
|
+
if isinstance(statement.modes, list) is False:
|
|
216
|
+
statement.modes = []
|
|
217
|
+
statement.modes = [x.upper() for x in statement.modes]
|
|
218
|
+
if sql_category == "ml_engines":
|
|
219
|
+
new_statement = Select(
|
|
220
|
+
targets=[Star()],
|
|
221
|
+
from_table=Identifier(parts=["information_schema", "ml_engines"]),
|
|
222
|
+
where=_get_show_where(statement, like_name="name"),
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
226
|
+
return self.answer_select(query)
|
|
227
|
+
elif sql_category == "handlers":
|
|
228
|
+
new_statement = Select(
|
|
229
|
+
targets=[Star()],
|
|
230
|
+
from_table=Identifier(parts=["information_schema", "handlers"]),
|
|
231
|
+
where=_get_show_where(statement, like_name="name"),
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
235
|
+
return self.answer_select(query)
|
|
236
|
+
elif sql_category == "plugins":
|
|
237
|
+
if statement.where is not None or statement.like:
|
|
238
|
+
raise ExecutorException(
|
|
239
|
+
"'SHOW PLUGINS' query should be used without filters"
|
|
240
|
+
)
|
|
241
|
+
new_statement = Select(
|
|
242
|
+
targets=[Star()],
|
|
243
|
+
from_table=Identifier(parts=["information_schema", "PLUGINS"]),
|
|
244
|
+
)
|
|
245
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
246
|
+
return self.answer_select(query)
|
|
247
|
+
elif sql_category in ("databases", "schemas"):
|
|
248
|
+
new_statement = Select(
|
|
249
|
+
targets=[Identifier(parts=["NAME"], alias=Identifier("Database"))],
|
|
250
|
+
from_table=Identifier(parts=["information_schema", "DATABASES"]),
|
|
251
|
+
where=_get_show_where(statement, like_name="Database"),
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
if "FULL" in statement.modes:
|
|
255
|
+
new_statement.targets.extend(
|
|
256
|
+
[
|
|
257
|
+
Identifier(parts=["TYPE"], alias=Identifier("TYPE")),
|
|
258
|
+
Identifier(parts=["ENGINE"], alias=Identifier("ENGINE")),
|
|
259
|
+
]
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
263
|
+
return self.answer_select(query)
|
|
264
|
+
elif sql_category in ("tables", "full tables"):
|
|
265
|
+
schema = database_name or "mindsdb"
|
|
266
|
+
if (
|
|
267
|
+
statement.from_table is not None
|
|
268
|
+
and statement.in_table is not None
|
|
269
|
+
):
|
|
270
|
+
raise ExecutorException(
|
|
271
|
+
"You have an error in your SQL syntax: 'from' and 'in' cannot be used together"
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
if statement.from_table is not None:
|
|
275
|
+
schema = statement.from_table.parts[-1]
|
|
276
|
+
statement.from_table = None
|
|
277
|
+
if statement.in_table is not None:
|
|
278
|
+
schema = statement.in_table.parts[-1]
|
|
279
|
+
statement.in_table = None
|
|
280
|
+
|
|
281
|
+
table_types = [Constant(t) for t in ['MODEL', 'BASE TABLE', 'SYSTEM VIEW', 'VIEW']]
|
|
282
|
+
where = BinaryOperation(
|
|
283
|
+
"and",
|
|
284
|
+
args=[
|
|
285
|
+
BinaryOperation("=", args=[Identifier("table_schema"), Constant(schema)]),
|
|
286
|
+
BinaryOperation("in", args=[Identifier("table_type"), Tuple(table_types)])
|
|
287
|
+
]
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
new_statement = Select(
|
|
291
|
+
targets=[
|
|
292
|
+
Identifier(
|
|
293
|
+
parts=["table_name"],
|
|
294
|
+
alias=Identifier(f"Tables_in_{schema}"),
|
|
295
|
+
)
|
|
296
|
+
],
|
|
297
|
+
from_table=Identifier(parts=["information_schema", "TABLES"]),
|
|
298
|
+
where=_get_show_where(
|
|
299
|
+
statement, like_name=f"Tables_in_{schema}", initial=where
|
|
300
|
+
),
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
if "FULL" in statement.modes:
|
|
304
|
+
new_statement.targets.append(
|
|
305
|
+
Identifier(parts=["TABLE_TYPE"], alias=Identifier("Table_type"))
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
309
|
+
return self.answer_select(query)
|
|
310
|
+
elif sql_category in (
|
|
311
|
+
"variables",
|
|
312
|
+
"session variables",
|
|
313
|
+
"session status",
|
|
314
|
+
"global variables",
|
|
315
|
+
):
|
|
316
|
+
new_statement = Select(
|
|
317
|
+
targets=[
|
|
318
|
+
Identifier(parts=["Variable_name"]),
|
|
319
|
+
Identifier(parts=["Value"]),
|
|
320
|
+
],
|
|
321
|
+
from_table=Identifier(parts=["dataframe"]),
|
|
322
|
+
where=_get_show_where(statement, like_name="Variable_name"),
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
data = {}
|
|
326
|
+
is_session = "session" in sql_category
|
|
327
|
+
for var_name, var_data in SERVER_VARIABLES.items():
|
|
328
|
+
var_name = var_name.replace("@@", "")
|
|
329
|
+
if is_session and var_name.startswith("session.") is False:
|
|
330
|
+
continue
|
|
331
|
+
if var_name.startswith("session.") or var_name.startswith(
|
|
332
|
+
"GLOBAL."
|
|
333
|
+
):
|
|
334
|
+
name = var_name.replace("session.", "").replace("GLOBAL.", "")
|
|
335
|
+
data[name] = var_data[0]
|
|
336
|
+
elif var_name not in data:
|
|
337
|
+
data[var_name] = var_data[0]
|
|
338
|
+
|
|
339
|
+
df = pd.DataFrame(data.items(), columns=["Variable_name", "Value"])
|
|
340
|
+
df2 = query_df(df, new_statement)
|
|
341
|
+
|
|
342
|
+
return ExecuteAnswer(
|
|
343
|
+
data=ResultSet().from_df(df2, table_name="session_variables")
|
|
344
|
+
)
|
|
345
|
+
elif sql_category == "search_path":
|
|
346
|
+
return ExecuteAnswer(
|
|
347
|
+
data=ResultSet(
|
|
348
|
+
columns=[
|
|
349
|
+
Column(name="search_path", table_name="search_path", type="str")
|
|
350
|
+
],
|
|
351
|
+
values=[['"$user", public']]
|
|
352
|
+
)
|
|
353
|
+
)
|
|
354
|
+
elif "show status like 'ssl_version'" in sql_lower:
|
|
355
|
+
return ExecuteAnswer(
|
|
356
|
+
data=ResultSet(
|
|
357
|
+
columns=[
|
|
358
|
+
Column(
|
|
359
|
+
name="Value", table_name="session_variables", type="str"
|
|
360
|
+
),
|
|
361
|
+
Column(
|
|
362
|
+
name="Value", table_name="session_variables", type="str"
|
|
363
|
+
),
|
|
364
|
+
],
|
|
365
|
+
values=[["Ssl_version", "TLSv1.1"]],
|
|
366
|
+
)
|
|
367
|
+
)
|
|
368
|
+
elif sql_category in ("function status", "procedure status"):
|
|
369
|
+
# SHOW FUNCTION STATUS WHERE Db = 'MINDSDB';
|
|
370
|
+
# SHOW PROCEDURE STATUS WHERE Db = 'MINDSDB'
|
|
371
|
+
# SHOW FUNCTION STATUS WHERE Db = 'MINDSDB' AND Name LIKE '%';
|
|
372
|
+
return self.answer_function_status()
|
|
373
|
+
elif sql_category in ("index", "keys", "indexes"):
|
|
374
|
+
# INDEX | INDEXES | KEYS are synonyms
|
|
375
|
+
# https://dev.mysql.com/doc/refman/8.0/en/show-index.html
|
|
376
|
+
new_statement = Select(
|
|
377
|
+
targets=[
|
|
378
|
+
Identifier("TABLE_NAME", alias=Identifier("Table")),
|
|
379
|
+
Identifier("NON_UNIQUE", alias=Identifier("Non_unique")),
|
|
380
|
+
Identifier("INDEX_NAME", alias=Identifier("Key_name")),
|
|
381
|
+
Identifier("SEQ_IN_INDEX", alias=Identifier("Seq_in_index")),
|
|
382
|
+
Identifier("COLUMN_NAME", alias=Identifier("Column_name")),
|
|
383
|
+
Identifier("COLLATION", alias=Identifier("Collation")),
|
|
384
|
+
Identifier("CARDINALITY", alias=Identifier("Cardinality")),
|
|
385
|
+
Identifier("SUB_PART", alias=Identifier("Sub_part")),
|
|
386
|
+
Identifier("PACKED", alias=Identifier("Packed")),
|
|
387
|
+
Identifier("NULLABLE", alias=Identifier("Null")),
|
|
388
|
+
Identifier("INDEX_TYPE", alias=Identifier("Index_type")),
|
|
389
|
+
Identifier("COMMENT", alias=Identifier("Comment")),
|
|
390
|
+
Identifier("INDEX_COMMENT", alias=Identifier("Index_comment")),
|
|
391
|
+
Identifier("IS_VISIBLE", alias=Identifier("Visible")),
|
|
392
|
+
Identifier("EXPRESSION", alias=Identifier("Expression")),
|
|
393
|
+
],
|
|
394
|
+
from_table=Identifier(parts=["information_schema", "STATISTICS"]),
|
|
395
|
+
where=statement.where,
|
|
396
|
+
)
|
|
397
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
398
|
+
return self.answer_select(query)
|
|
399
|
+
# FIXME if have answer on that request, then DataGrip show warning '[S0022] Column 'Non_unique' not found.'
|
|
400
|
+
elif "show create table" in sql_lower:
|
|
401
|
+
# SHOW CREATE TABLE `MINDSDB`.`predictors`
|
|
402
|
+
table = sql[sql.rfind(".") + 1:].strip(" .;\n\t").replace("`", "")
|
|
403
|
+
return self.answer_show_create_table(table)
|
|
404
|
+
elif sql_category in ("character set", "charset"):
|
|
405
|
+
new_statement = Select(
|
|
406
|
+
targets=[
|
|
407
|
+
Identifier("CHARACTER_SET_NAME", alias=Identifier("Charset")),
|
|
408
|
+
Identifier(
|
|
409
|
+
"DEFAULT_COLLATE_NAME", alias=Identifier("Description")
|
|
410
|
+
),
|
|
411
|
+
Identifier(
|
|
412
|
+
"DESCRIPTION", alias=Identifier("Default collation")
|
|
413
|
+
),
|
|
414
|
+
Identifier("MAXLEN", alias=Identifier("Maxlen")),
|
|
415
|
+
],
|
|
416
|
+
from_table=Identifier(
|
|
417
|
+
parts=["INFORMATION_SCHEMA", "CHARACTER_SETS"]
|
|
418
|
+
),
|
|
419
|
+
where=_get_show_where(statement, like_name="CHARACTER_SET_NAME"),
|
|
420
|
+
)
|
|
421
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
422
|
+
return self.answer_select(query)
|
|
423
|
+
elif sql_category == "warnings":
|
|
424
|
+
return self.answer_show_warnings()
|
|
425
|
+
elif sql_category == "engines":
|
|
426
|
+
new_statement = Select(
|
|
427
|
+
targets=[Star()],
|
|
428
|
+
from_table=Identifier(parts=["information_schema", "ENGINES"]),
|
|
429
|
+
)
|
|
430
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
431
|
+
return self.answer_select(query)
|
|
432
|
+
elif sql_category == "collation":
|
|
433
|
+
new_statement = Select(
|
|
434
|
+
targets=[
|
|
435
|
+
Identifier("COLLATION_NAME", alias=Identifier("Collation")),
|
|
436
|
+
Identifier("CHARACTER_SET_NAME", alias=Identifier("Charset")),
|
|
437
|
+
Identifier("ID", alias=Identifier("Id")),
|
|
438
|
+
Identifier("IS_DEFAULT", alias=Identifier("Default")),
|
|
439
|
+
Identifier("IS_COMPILED", alias=Identifier("Compiled")),
|
|
440
|
+
Identifier("SORTLEN", alias=Identifier("Sortlen")),
|
|
441
|
+
Identifier("PAD_ATTRIBUTE", alias=Identifier("Pad_attribute")),
|
|
442
|
+
],
|
|
443
|
+
from_table=Identifier(parts=["INFORMATION_SCHEMA", "COLLATIONS"]),
|
|
444
|
+
where=_get_show_where(statement, like_name="Collation"),
|
|
445
|
+
)
|
|
446
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
447
|
+
return self.answer_select(query)
|
|
448
|
+
elif sql_category == "table status":
|
|
449
|
+
# TODO improve it
|
|
450
|
+
# SHOW TABLE STATUS LIKE 'table'
|
|
451
|
+
table_name = None
|
|
452
|
+
if statement.like is not None:
|
|
453
|
+
table_name = statement.like
|
|
454
|
+
# elif condition == 'from' and type(expression) == Identifier:
|
|
455
|
+
# table_name = expression.parts[-1]
|
|
456
|
+
if table_name is None:
|
|
457
|
+
err_str = f"Can't determine table name in query: {sql}"
|
|
458
|
+
logger.warning(err_str)
|
|
459
|
+
raise TableNotExistError(err_str)
|
|
460
|
+
return self.answer_show_table_status(table_name)
|
|
461
|
+
elif sql_category == "columns":
|
|
462
|
+
is_full = statement.modes is not None and "full" in statement.modes
|
|
463
|
+
return self.answer_show_columns(
|
|
464
|
+
statement.from_table,
|
|
465
|
+
statement.where,
|
|
466
|
+
statement.like,
|
|
467
|
+
is_full=is_full,
|
|
468
|
+
database_name=database_name,
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
elif sql_category in ("agents", "jobs", "skills", "chatbots", "triggers", "views",
|
|
472
|
+
"knowledge_bases", "knowledge bases", "predictors", "models"):
|
|
473
|
+
|
|
474
|
+
if sql_category == "knowledge bases":
|
|
475
|
+
sql_category = "knowledge_bases"
|
|
476
|
+
|
|
477
|
+
if sql_category == "predictors":
|
|
478
|
+
sql_category = "models"
|
|
479
|
+
|
|
480
|
+
db_name = database_name
|
|
481
|
+
if statement.from_table is not None:
|
|
482
|
+
db_name = statement.from_table.parts[-1]
|
|
483
|
+
|
|
484
|
+
where = BinaryOperation(op='=', args=[Identifier('project'), Constant(db_name)])
|
|
485
|
+
|
|
486
|
+
select_statement = Select(
|
|
487
|
+
targets=[Star()],
|
|
488
|
+
from_table=Identifier(
|
|
489
|
+
parts=["information_schema", sql_category]
|
|
490
|
+
),
|
|
491
|
+
where=_get_show_where(statement, like_name="name", initial=where),
|
|
492
|
+
)
|
|
493
|
+
query = SQLQuery(select_statement, session=self.session)
|
|
494
|
+
return self.answer_select(query)
|
|
495
|
+
|
|
496
|
+
elif sql_category == "projects":
|
|
497
|
+
where = BinaryOperation(op='=', args=[Identifier('type'), Constant('project')])
|
|
498
|
+
select_statement = Select(
|
|
499
|
+
targets=[Identifier(parts=["NAME"], alias=Identifier('project'))],
|
|
500
|
+
from_table=Identifier(
|
|
501
|
+
parts=["information_schema", "DATABASES"]
|
|
502
|
+
),
|
|
503
|
+
where=_get_show_where(statement, like_name="project", from_name="project", initial=where),
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
query = SQLQuery(select_statement, session=self.session)
|
|
507
|
+
return self.answer_select(query)
|
|
508
|
+
else:
|
|
509
|
+
raise NotSupportedYet(f"Statement not implemented: {sql}")
|
|
510
|
+
elif type(statement) in (
|
|
511
|
+
StartTransaction,
|
|
512
|
+
CommitTransaction,
|
|
513
|
+
RollbackTransaction,
|
|
514
|
+
):
|
|
515
|
+
return ExecuteAnswer()
|
|
516
|
+
elif type(statement) is Set:
|
|
517
|
+
category = (statement.category or "").lower()
|
|
518
|
+
if category == "" and isinstance(statement.name, Identifier):
|
|
519
|
+
param = statement.name.parts[0].lower()
|
|
520
|
+
|
|
521
|
+
value = None
|
|
522
|
+
if isinstance(statement.value, Constant):
|
|
523
|
+
value = statement.value.value
|
|
524
|
+
|
|
525
|
+
if param == "profiling":
|
|
526
|
+
self.session.profiling = value in (1, True)
|
|
527
|
+
if self.session.profiling is True:
|
|
528
|
+
profiler.enable()
|
|
529
|
+
else:
|
|
530
|
+
profiler.disable()
|
|
531
|
+
elif param == "predictor_cache":
|
|
532
|
+
self.session.predictor_cache = value in (1, True)
|
|
533
|
+
elif param == "context":
|
|
534
|
+
if value in (0, False, None):
|
|
535
|
+
# drop context
|
|
536
|
+
query_context_controller.drop_query_context(None)
|
|
537
|
+
elif param == "show_secrets":
|
|
538
|
+
self.session.show_secrets = value in (1, True)
|
|
539
|
+
|
|
540
|
+
return ExecuteAnswer()
|
|
541
|
+
elif category == "autocommit":
|
|
542
|
+
return ExecuteAnswer()
|
|
543
|
+
elif category == "names":
|
|
544
|
+
# set names utf8;
|
|
545
|
+
charsets = {
|
|
546
|
+
"utf8": CHARSET_NUMBERS["utf8_general_ci"],
|
|
547
|
+
"utf8mb4": CHARSET_NUMBERS["utf8mb4_general_ci"],
|
|
548
|
+
}
|
|
549
|
+
self.charset = statement.value.value
|
|
550
|
+
self.charset_text_type = charsets.get(self.charset)
|
|
551
|
+
if self.charset_text_type is None:
|
|
552
|
+
logger.warning(
|
|
553
|
+
f"Unknown charset: {self.charset}. Setting up 'utf8_general_ci' as charset text type."
|
|
554
|
+
)
|
|
555
|
+
self.charset_text_type = CHARSET_NUMBERS["utf8_general_ci"]
|
|
556
|
+
return ExecuteAnswer(
|
|
557
|
+
state_track=[
|
|
558
|
+
["character_set_client", self.charset],
|
|
559
|
+
["character_set_connection", self.charset],
|
|
560
|
+
["character_set_results", self.charset],
|
|
561
|
+
],
|
|
562
|
+
)
|
|
563
|
+
elif category == "active":
|
|
564
|
+
return self.answer_update_model_version(statement.value, database_name)
|
|
565
|
+
|
|
566
|
+
else:
|
|
567
|
+
logger.warning(
|
|
568
|
+
f"SQL statement is not processable, return OK package: {sql}"
|
|
569
|
+
)
|
|
570
|
+
return ExecuteAnswer()
|
|
571
|
+
elif type(statement) is Use:
|
|
572
|
+
db_name = statement.value.parts[-1]
|
|
573
|
+
self.change_default_db(db_name)
|
|
574
|
+
return ExecuteAnswer()
|
|
575
|
+
elif type(statement) in (
|
|
576
|
+
CreatePredictor,
|
|
577
|
+
CreateAnomalyDetectionModel, # we may want to specialize these in the future
|
|
578
|
+
):
|
|
579
|
+
return self.answer_create_predictor(statement, database_name)
|
|
580
|
+
elif type(statement) is CreateView:
|
|
581
|
+
return self.answer_create_view(statement, database_name)
|
|
582
|
+
elif type(statement) is DropView:
|
|
583
|
+
return self.answer_drop_view(statement, database_name)
|
|
584
|
+
elif type(statement) is Delete:
|
|
585
|
+
SQLQuery(statement, session=self.session, execute=True, database=database_name)
|
|
586
|
+
return ExecuteAnswer()
|
|
587
|
+
|
|
588
|
+
elif type(statement) is Insert:
|
|
589
|
+
SQLQuery(statement, session=self.session, execute=True, database=database_name)
|
|
590
|
+
return ExecuteAnswer()
|
|
591
|
+
elif type(statement) is Update:
|
|
592
|
+
SQLQuery(statement, session=self.session, execute=True, database=database_name)
|
|
593
|
+
return ExecuteAnswer()
|
|
594
|
+
elif (
|
|
595
|
+
type(statement) is Alter
|
|
596
|
+
and ("disable keys" in sql_lower)
|
|
597
|
+
or ("enable keys" in sql_lower)
|
|
598
|
+
):
|
|
599
|
+
return ExecuteAnswer()
|
|
600
|
+
elif type(statement) is Select:
|
|
601
|
+
if statement.from_table is None:
|
|
602
|
+
return self.answer_single_row_select(statement, database_name)
|
|
603
|
+
query = SQLQuery(statement, session=self.session, database=database_name)
|
|
604
|
+
return self.answer_select(query)
|
|
605
|
+
elif type(statement) is Union:
|
|
606
|
+
query = SQLQuery(statement, session=self.session, database=database_name)
|
|
607
|
+
return self.answer_select(query)
|
|
608
|
+
elif type(statement) is Explain:
|
|
609
|
+
return self.answer_show_columns(statement.target, database_name=database_name)
|
|
610
|
+
elif type(statement) is CreateTable:
|
|
611
|
+
return self.answer_create_table(statement, database_name)
|
|
612
|
+
# -- jobs --
|
|
613
|
+
elif type(statement) is CreateJob:
|
|
614
|
+
return self.answer_create_job(statement, database_name)
|
|
615
|
+
elif type(statement) is DropJob:
|
|
616
|
+
return self.answer_drop_job(statement, database_name)
|
|
617
|
+
# -- triggers --
|
|
618
|
+
elif type(statement) is CreateTrigger:
|
|
619
|
+
return self.answer_create_trigger(statement, database_name)
|
|
620
|
+
elif type(statement) is DropTrigger:
|
|
621
|
+
return self.answer_drop_trigger(statement, database_name)
|
|
622
|
+
# -- chatbots
|
|
623
|
+
elif type(statement) is CreateChatBot:
|
|
624
|
+
return self.answer_create_chatbot(statement, database_name)
|
|
625
|
+
elif type(statement) is UpdateChatBot:
|
|
626
|
+
return self.answer_update_chatbot(statement, database_name)
|
|
627
|
+
elif type(statement) is DropChatBot:
|
|
628
|
+
return self.answer_drop_chatbot(statement, database_name)
|
|
629
|
+
elif type(statement) is CreateKnowledgeBase:
|
|
630
|
+
return self.answer_create_kb(statement, database_name)
|
|
631
|
+
elif type(statement) is DropKnowledgeBase:
|
|
632
|
+
return self.answer_drop_kb(statement, database_name)
|
|
633
|
+
elif type(statement) is CreateSkill:
|
|
634
|
+
return self.answer_create_skill(statement, database_name)
|
|
635
|
+
elif type(statement) is DropSkill:
|
|
636
|
+
return self.answer_drop_skill(statement, database_name)
|
|
637
|
+
elif type(statement) is UpdateSkill:
|
|
638
|
+
return self.answer_update_skill(statement, database_name)
|
|
639
|
+
elif type(statement) is CreateAgent:
|
|
640
|
+
return self.answer_create_agent(statement, database_name)
|
|
641
|
+
elif type(statement) is DropAgent:
|
|
642
|
+
return self.answer_drop_agent(statement, database_name)
|
|
643
|
+
elif type(statement) is UpdateAgent:
|
|
644
|
+
return self.answer_update_agent(statement, database_name)
|
|
645
|
+
elif type(statement) is Evaluate:
|
|
646
|
+
statement.data = parse_sql(statement.query_str)
|
|
647
|
+
return self.answer_evaluate_metric(statement, database_name)
|
|
648
|
+
else:
|
|
649
|
+
logger.warning(f"Unknown SQL statement: {sql}")
|
|
650
|
+
raise NotSupportedYet(f"Unknown SQL statement: {sql}")
|
|
651
|
+
|
|
652
|
+
def answer_create_trigger(self, statement, database_name):
|
|
653
|
+
triggers_controller = TriggersController()
|
|
654
|
+
|
|
655
|
+
name = statement.name
|
|
656
|
+
trigger_name = statement.name.parts[-1]
|
|
657
|
+
project_name = name.parts[-2] if len(name.parts) > 1 else database_name
|
|
658
|
+
|
|
659
|
+
triggers_controller.add(
|
|
660
|
+
trigger_name,
|
|
661
|
+
project_name,
|
|
662
|
+
statement.table,
|
|
663
|
+
statement.query_str,
|
|
664
|
+
statement.columns,
|
|
665
|
+
)
|
|
666
|
+
return ExecuteAnswer()
|
|
667
|
+
|
|
668
|
+
def answer_drop_trigger(self, statement, database_name):
|
|
669
|
+
triggers_controller = TriggersController()
|
|
670
|
+
|
|
671
|
+
name = statement.name
|
|
672
|
+
trigger_name = statement.name.parts[-1]
|
|
673
|
+
project_name = name.parts[-2] if len(name.parts) > 1 else database_name
|
|
674
|
+
|
|
675
|
+
triggers_controller.delete(trigger_name, project_name)
|
|
676
|
+
|
|
677
|
+
return ExecuteAnswer()
|
|
678
|
+
|
|
679
|
+
def answer_create_job(self, statement: CreateJob, database_name):
|
|
680
|
+
jobs_controller = JobsController()
|
|
681
|
+
|
|
682
|
+
name = statement.name
|
|
683
|
+
job_name = name.parts[-1]
|
|
684
|
+
project_name = name.parts[-2] if len(name.parts) > 1 else database_name
|
|
685
|
+
|
|
686
|
+
try:
|
|
687
|
+
jobs_controller.create(job_name, project_name, statement)
|
|
688
|
+
except EntityExistsError:
|
|
689
|
+
if getattr(statement, "if_not_exists", False) is False:
|
|
690
|
+
raise
|
|
691
|
+
|
|
692
|
+
return ExecuteAnswer()
|
|
693
|
+
|
|
694
|
+
def answer_drop_job(self, statement, database_name):
|
|
695
|
+
jobs_controller = JobsController()
|
|
696
|
+
|
|
697
|
+
name = statement.name
|
|
698
|
+
job_name = name.parts[-1]
|
|
699
|
+
project_name = name.parts[-2] if len(name.parts) > 1 else database_name
|
|
700
|
+
try:
|
|
701
|
+
jobs_controller.delete(job_name, project_name)
|
|
702
|
+
except EntityNotExistsError:
|
|
703
|
+
if statement.if_exists is False:
|
|
704
|
+
raise
|
|
705
|
+
except Exception as e:
|
|
706
|
+
raise e
|
|
707
|
+
|
|
708
|
+
return ExecuteAnswer()
|
|
709
|
+
|
|
710
|
+
def answer_create_chatbot(self, statement, database_name):
|
|
711
|
+
chatbot_controller = ChatBotController()
|
|
712
|
+
|
|
713
|
+
name = statement.name
|
|
714
|
+
project_name = name.parts[-2] if len(name.parts) > 1 else database_name
|
|
715
|
+
is_running = statement.params.pop("is_running", True)
|
|
716
|
+
|
|
717
|
+
database = self.session.integration_controller.get(statement.database.parts[-1])
|
|
718
|
+
if database is None:
|
|
719
|
+
raise ExecutorException(f"Database not found: {statement.database}")
|
|
720
|
+
|
|
721
|
+
# Database ID cannot be null
|
|
722
|
+
database_id = database["id"] if database is not None else -1
|
|
723
|
+
|
|
724
|
+
model_name = None
|
|
725
|
+
if statement.model is not None:
|
|
726
|
+
model_name = statement.model.parts[-1]
|
|
727
|
+
|
|
728
|
+
agent_name = None
|
|
729
|
+
if statement.agent is not None:
|
|
730
|
+
agent_name = statement.agent.parts[-1]
|
|
731
|
+
chatbot_controller.add_chatbot(
|
|
732
|
+
name.parts[-1],
|
|
733
|
+
project_name=project_name,
|
|
734
|
+
model_name=model_name,
|
|
735
|
+
agent_name=agent_name,
|
|
736
|
+
database_id=database_id,
|
|
737
|
+
is_running=is_running,
|
|
738
|
+
params=statement.params,
|
|
739
|
+
)
|
|
740
|
+
return ExecuteAnswer()
|
|
741
|
+
|
|
742
|
+
def answer_update_chatbot(self, statement, database_name):
|
|
743
|
+
chatbot_controller = ChatBotController()
|
|
744
|
+
|
|
745
|
+
name = statement.name
|
|
746
|
+
name_no_project = name.parts[-1]
|
|
747
|
+
project_name = name.parts[-2] if len(name.parts) > 1 else database_name
|
|
748
|
+
|
|
749
|
+
# From SET keyword parameters
|
|
750
|
+
updated_name = statement.params.pop("name", None)
|
|
751
|
+
model_name = statement.params.pop("model", None)
|
|
752
|
+
agent_name = statement.params.pop("agent", None)
|
|
753
|
+
database_name = statement.params.pop("database", None)
|
|
754
|
+
is_running = statement.params.pop("is_running", None)
|
|
755
|
+
|
|
756
|
+
database_id = None
|
|
757
|
+
if database_name is not None:
|
|
758
|
+
database = self.session.integration_controller.get(database_name)
|
|
759
|
+
if database is None:
|
|
760
|
+
raise ExecutorException(f"Database with name {database_name} not found")
|
|
761
|
+
database_id = database["id"]
|
|
762
|
+
|
|
763
|
+
updated_chatbot = chatbot_controller.update_chatbot(
|
|
764
|
+
name_no_project,
|
|
765
|
+
project_name=project_name,
|
|
766
|
+
name=updated_name,
|
|
767
|
+
model_name=model_name,
|
|
768
|
+
agent_name=agent_name,
|
|
769
|
+
database_id=database_id,
|
|
770
|
+
is_running=is_running,
|
|
771
|
+
params=statement.params,
|
|
772
|
+
)
|
|
773
|
+
if updated_chatbot is None:
|
|
774
|
+
raise ExecutorException(f"Chatbot with name {name_no_project} not found")
|
|
775
|
+
return ExecuteAnswer()
|
|
776
|
+
|
|
777
|
+
def answer_drop_chatbot(self, statement, database_name):
|
|
778
|
+
chatbot_controller = ChatBotController()
|
|
779
|
+
|
|
780
|
+
name = statement.name
|
|
781
|
+
project_name = name.parts[-2] if len(name.parts) > 1 else database_name
|
|
782
|
+
|
|
783
|
+
chatbot_controller.delete_chatbot(name.parts[-1], project_name=project_name)
|
|
784
|
+
return ExecuteAnswer()
|
|
785
|
+
|
|
786
|
+
def answer_evaluate_metric(self, statement, database_name):
|
|
787
|
+
try:
|
|
788
|
+
sqlquery = SQLQuery(statement.data, session=self.session, database=database_name)
|
|
789
|
+
except Exception as e:
|
|
790
|
+
raise Exception(
|
|
791
|
+
f'Nested query failed to execute with error: "{e}", please check and try again.'
|
|
792
|
+
)
|
|
793
|
+
result = sqlquery.fetch('dataframe')
|
|
794
|
+
df = result["result"]
|
|
795
|
+
df.columns = [
|
|
796
|
+
str(t.alias) if hasattr(t, "alias") else str(t.parts[-1])
|
|
797
|
+
for t in statement.data.targets
|
|
798
|
+
]
|
|
799
|
+
|
|
800
|
+
for col in ["actual", "prediction"]:
|
|
801
|
+
assert (
|
|
802
|
+
col in df.columns
|
|
803
|
+
), f"`{col}` column was not provided, please try again."
|
|
804
|
+
assert (
|
|
805
|
+
df[col].isna().sum() == 0
|
|
806
|
+
), f"There are missing values in the `{col}` column, please try again."
|
|
807
|
+
|
|
808
|
+
metric_name = statement.name.parts[-1]
|
|
809
|
+
target_series = df.pop("prediction")
|
|
810
|
+
using_clause = statement.using if statement.using is not None else {}
|
|
811
|
+
metric_value = evaluate_accuracy(
|
|
812
|
+
df,
|
|
813
|
+
target_series,
|
|
814
|
+
metric_name,
|
|
815
|
+
target="actual",
|
|
816
|
+
ts_analysis=using_clause.get("ts_analysis", {}), # will be deprecated soon
|
|
817
|
+
n_decimals=using_clause.get("n_decimals", 3),
|
|
818
|
+
) # 3 decimals by default
|
|
819
|
+
return ExecuteAnswer(
|
|
820
|
+
data=ResultSet(
|
|
821
|
+
columns=[Column(name=metric_name, table_name="", type="str")],
|
|
822
|
+
values=[[metric_value]],
|
|
823
|
+
)
|
|
824
|
+
)
|
|
825
|
+
|
|
826
|
+
def answer_describe_object(self, obj_type: str, obj_name: Identifier, database_name: str):
|
|
827
|
+
|
|
828
|
+
project_objects = ("AGENTS", "JOBS", "SKILLS", "CHATBOTS", "TRIGGERS", "VIEWS",
|
|
829
|
+
"KNOWLEDGE_BASES", "PREDICTORS", "MODELS")
|
|
830
|
+
|
|
831
|
+
global_objects = ("DATABASES", "PROJECTS", "HANDLERS", "ML_ENGINES")
|
|
832
|
+
|
|
833
|
+
all_objects = project_objects + global_objects
|
|
834
|
+
|
|
835
|
+
# is not plural?
|
|
836
|
+
if obj_type not in all_objects:
|
|
837
|
+
if obj_type + 'S' in all_objects:
|
|
838
|
+
obj_type = obj_type + 'S'
|
|
839
|
+
elif obj_type + 'ES' in all_objects:
|
|
840
|
+
obj_type = obj_type + 'ES'
|
|
841
|
+
else:
|
|
842
|
+
raise WrongArgumentError(f'Unknown describe type: {obj_type}')
|
|
843
|
+
|
|
844
|
+
name = obj_name.parts[-1]
|
|
845
|
+
where = BinaryOperation(op='=', args=[
|
|
846
|
+
Identifier('name'),
|
|
847
|
+
Constant(name)
|
|
848
|
+
])
|
|
849
|
+
|
|
850
|
+
if obj_type in project_objects:
|
|
851
|
+
where = BinaryOperation(op='and', args=[
|
|
852
|
+
where,
|
|
853
|
+
BinaryOperation(op='=', args=[Identifier('project'), Constant(database_name)])
|
|
854
|
+
])
|
|
855
|
+
|
|
856
|
+
select_statement = Select(
|
|
857
|
+
targets=[Star()],
|
|
858
|
+
from_table=Identifier(
|
|
859
|
+
parts=["information_schema", obj_type]
|
|
860
|
+
),
|
|
861
|
+
|
|
862
|
+
where=where,
|
|
863
|
+
)
|
|
864
|
+
query = SQLQuery(select_statement, session=self.session)
|
|
865
|
+
return self.answer_select(query)
|
|
866
|
+
|
|
867
|
+
def answer_describe_predictor(self, obj_name, database_name):
|
|
868
|
+
value = obj_name.parts.copy()
|
|
869
|
+
# project.model.version.?attrs
|
|
870
|
+
parts = value[:3]
|
|
871
|
+
attrs = value[3:]
|
|
872
|
+
model_info = self._get_model_info(Identifier(parts=parts), except_absent=False, database_name=database_name)
|
|
873
|
+
if model_info is None:
|
|
874
|
+
# project.model.?attrs
|
|
875
|
+
parts = value[:2]
|
|
876
|
+
attrs = value[2:]
|
|
877
|
+
model_info = self._get_model_info(Identifier(parts=parts), except_absent=False, database_name=database_name)
|
|
878
|
+
if model_info is None:
|
|
879
|
+
# model.?attrs
|
|
880
|
+
parts = value[:1]
|
|
881
|
+
attrs = value[1:]
|
|
882
|
+
model_info = self._get_model_info(Identifier(parts=parts), except_absent=False, database_name=database_name)
|
|
883
|
+
|
|
884
|
+
if model_info is None:
|
|
885
|
+
raise ExecutorException(f"Model not found: {obj_name}")
|
|
886
|
+
|
|
887
|
+
if len(attrs) == 1:
|
|
888
|
+
attrs = attrs[0]
|
|
889
|
+
elif len(attrs) == 0:
|
|
890
|
+
attrs = None
|
|
891
|
+
|
|
892
|
+
df = self.session.model_controller.describe_model(
|
|
893
|
+
self.session,
|
|
894
|
+
model_info["project_name"],
|
|
895
|
+
model_info["model_record"].name,
|
|
896
|
+
attribute=attrs,
|
|
897
|
+
version=model_info['model_record'].version
|
|
898
|
+
)
|
|
899
|
+
|
|
900
|
+
return ExecuteAnswer(
|
|
901
|
+
data=ResultSet().from_df(df, table_name="")
|
|
902
|
+
)
|
|
903
|
+
|
|
904
|
+
def _get_model_info(self, identifier, except_absent=True, database_name=None):
|
|
905
|
+
if len(identifier.parts) == 1:
|
|
906
|
+
identifier.parts = [database_name, identifier.parts[0]]
|
|
907
|
+
|
|
908
|
+
database_name, model_name, model_version = resolve_model_identifier(identifier)
|
|
909
|
+
if database_name is None:
|
|
910
|
+
database_name = database_name
|
|
911
|
+
|
|
912
|
+
if model_name is None:
|
|
913
|
+
if except_absent:
|
|
914
|
+
raise Exception(f"Model not found: {identifier.to_string()}")
|
|
915
|
+
else:
|
|
916
|
+
return
|
|
917
|
+
|
|
918
|
+
model_record = get_model_record(
|
|
919
|
+
name=model_name,
|
|
920
|
+
project_name=database_name,
|
|
921
|
+
except_absent=except_absent,
|
|
922
|
+
version=model_version,
|
|
923
|
+
active=True if model_version is None else None,
|
|
924
|
+
)
|
|
925
|
+
if not model_record:
|
|
926
|
+
return None
|
|
927
|
+
return {"model_record": model_record, "project_name": database_name}
|
|
928
|
+
|
|
929
|
+
def _sync_predictor_check(self, phase_name):
|
|
930
|
+
"""Checks if there is already a predictor retraining or fine-tuning
|
|
931
|
+
Do not allow to run retrain if there is another model in training process in less that 1h
|
|
932
|
+
"""
|
|
933
|
+
is_cloud = self.session.config.get("cloud", False)
|
|
934
|
+
if is_cloud and ctx.user_class == 0:
|
|
935
|
+
models = get_model_records(active=None)
|
|
936
|
+
shortest_training = None
|
|
937
|
+
for model in models:
|
|
938
|
+
if (
|
|
939
|
+
model.status
|
|
940
|
+
in (PREDICTOR_STATUS.GENERATING, PREDICTOR_STATUS.TRAINING)
|
|
941
|
+
and model.training_start_at is not None
|
|
942
|
+
and model.training_stop_at is None
|
|
943
|
+
):
|
|
944
|
+
training_time = datetime.datetime.now() - model.training_start_at
|
|
945
|
+
if shortest_training is None or training_time < shortest_training:
|
|
946
|
+
shortest_training = training_time
|
|
947
|
+
|
|
948
|
+
if (
|
|
949
|
+
shortest_training is not None
|
|
950
|
+
and shortest_training < datetime.timedelta(hours=1)
|
|
951
|
+
):
|
|
952
|
+
raise ExecutorException(
|
|
953
|
+
f"Can't start {phase_name} process while any other predictor is in status 'training' or 'generating'"
|
|
954
|
+
)
|
|
955
|
+
|
|
956
|
+
def answer_retrain_predictor(self, statement, database_name):
|
|
957
|
+
model_record = self._get_model_info(statement.name, database_name=database_name)["model_record"]
|
|
958
|
+
|
|
959
|
+
if statement.query_str is None:
|
|
960
|
+
if model_record.data_integration_ref is not None:
|
|
961
|
+
if model_record.data_integration_ref["type"] == "integration":
|
|
962
|
+
integration = self.session.integration_controller.get_by_id(
|
|
963
|
+
model_record.data_integration_ref["id"]
|
|
964
|
+
)
|
|
965
|
+
if integration is None:
|
|
966
|
+
raise EntityNotExistsError(
|
|
967
|
+
"The database from which the model was trained no longer exists"
|
|
968
|
+
)
|
|
969
|
+
elif statement.integration_name is None:
|
|
970
|
+
# set to current project
|
|
971
|
+
statement.integration_name = Identifier(database_name)
|
|
972
|
+
|
|
973
|
+
ml_handler = None
|
|
974
|
+
if statement.using is not None:
|
|
975
|
+
# repack using with lower names
|
|
976
|
+
statement.using = {k.lower(): v for k, v in statement.using.items()}
|
|
977
|
+
|
|
978
|
+
if "engine" in statement.using:
|
|
979
|
+
ml_integration_name = statement.using.pop("engine")
|
|
980
|
+
ml_handler = self.session.integration_controller.get_ml_handler(
|
|
981
|
+
ml_integration_name
|
|
982
|
+
)
|
|
983
|
+
|
|
984
|
+
# use current ml handler
|
|
985
|
+
if ml_handler is None:
|
|
986
|
+
integration_record = get_predictor_integration(model_record)
|
|
987
|
+
if integration_record is None:
|
|
988
|
+
raise EntityNotExistsError("ML engine model was trained with does not esxists")
|
|
989
|
+
ml_handler = self.session.integration_controller.get_ml_handler(
|
|
990
|
+
integration_record.name
|
|
991
|
+
)
|
|
992
|
+
|
|
993
|
+
self._sync_predictor_check(phase_name="retrain")
|
|
994
|
+
df = self.session.model_controller.retrain_model(statement, ml_handler)
|
|
995
|
+
|
|
996
|
+
return ExecuteAnswer(
|
|
997
|
+
data=ResultSet().from_df(df)
|
|
998
|
+
)
|
|
999
|
+
|
|
1000
|
+
@profiler.profile()
|
|
1001
|
+
@mark_process("learn")
|
|
1002
|
+
def answer_finetune_predictor(self, statement, database_name):
|
|
1003
|
+
model_record = self._get_model_info(statement.name, database_name=database_name)["model_record"]
|
|
1004
|
+
|
|
1005
|
+
if statement.using is not None:
|
|
1006
|
+
# repack using with lower names
|
|
1007
|
+
statement.using = {k.lower(): v for k, v in statement.using.items()}
|
|
1008
|
+
|
|
1009
|
+
if statement.query_str is not None and statement.integration_name is None:
|
|
1010
|
+
# set to current project
|
|
1011
|
+
statement.integration_name = Identifier(database_name)
|
|
1012
|
+
|
|
1013
|
+
# use current ml handler
|
|
1014
|
+
integration_record = get_predictor_integration(model_record)
|
|
1015
|
+
if integration_record is None:
|
|
1016
|
+
raise Exception(
|
|
1017
|
+
"The ML engine that the model was trained with does not exist."
|
|
1018
|
+
)
|
|
1019
|
+
ml_handler = self.session.integration_controller.get_ml_handler(
|
|
1020
|
+
integration_record.name
|
|
1021
|
+
)
|
|
1022
|
+
|
|
1023
|
+
self._sync_predictor_check(phase_name="finetune")
|
|
1024
|
+
df = self.session.model_controller.finetune_model(statement, ml_handler)
|
|
1025
|
+
|
|
1026
|
+
return ExecuteAnswer(
|
|
1027
|
+
data=ResultSet().from_df(df)
|
|
1028
|
+
)
|
|
1029
|
+
|
|
1030
|
+
def _create_integration(self, name: str, engine: str, connection_args: dict):
|
|
1031
|
+
# we have connection checkers not for any db. So do nothing if fail
|
|
1032
|
+
# TODO return rich error message
|
|
1033
|
+
|
|
1034
|
+
if connection_args is None:
|
|
1035
|
+
connection_args = {}
|
|
1036
|
+
status = HandlerStatusResponse(success=False)
|
|
1037
|
+
|
|
1038
|
+
storage = None
|
|
1039
|
+
try:
|
|
1040
|
+
handler_meta = self.session.integration_controller.get_handler_meta(engine)
|
|
1041
|
+
if handler_meta is None:
|
|
1042
|
+
raise ExecutorException(f"There is no engine '{engine}'")
|
|
1043
|
+
|
|
1044
|
+
if handler_meta.get("import", {}).get("success") is not True:
|
|
1045
|
+
raise ExecutorException(f"The '{engine}' handler isn't installed.\n" + get_handler_install_message(engine))
|
|
1046
|
+
|
|
1047
|
+
accept_connection_args = handler_meta.get("connection_args")
|
|
1048
|
+
if accept_connection_args is not None and connection_args is not None:
|
|
1049
|
+
for arg_name, arg_value in connection_args.items():
|
|
1050
|
+
if arg_name not in accept_connection_args:
|
|
1051
|
+
continue
|
|
1052
|
+
arg_meta = accept_connection_args[arg_name]
|
|
1053
|
+
arg_type = arg_meta.get("type")
|
|
1054
|
+
if arg_type == HANDLER_CONNECTION_ARG_TYPE.PATH:
|
|
1055
|
+
# arg may be one of:
|
|
1056
|
+
# str: '/home/file.pem'
|
|
1057
|
+
# dict: {'path': '/home/file.pem'}
|
|
1058
|
+
# dict: {'url': 'https://host.com/file'}
|
|
1059
|
+
arg_value = connection_args[arg_name]
|
|
1060
|
+
if isinstance(arg_value, (str, dict)) is False:
|
|
1061
|
+
raise ExecutorException(f"Unknown type of arg: '{arg_value}'")
|
|
1062
|
+
if isinstance(arg_value, str) or "path" in arg_value:
|
|
1063
|
+
path = (
|
|
1064
|
+
arg_value
|
|
1065
|
+
if isinstance(arg_value, str)
|
|
1066
|
+
else arg_value["path"]
|
|
1067
|
+
)
|
|
1068
|
+
if Path(path).is_file() is False:
|
|
1069
|
+
raise ExecutorException(f"File not found at: '{path}'")
|
|
1070
|
+
elif "url" in arg_value:
|
|
1071
|
+
path = download_file(arg_value["url"])
|
|
1072
|
+
else:
|
|
1073
|
+
raise ExecutorException(
|
|
1074
|
+
f"Argument '{arg_name}' must be path or url to the file"
|
|
1075
|
+
)
|
|
1076
|
+
connection_args[arg_name] = path
|
|
1077
|
+
|
|
1078
|
+
handler = self.session.integration_controller.create_tmp_handler(
|
|
1079
|
+
name=name,
|
|
1080
|
+
engine=engine,
|
|
1081
|
+
connection_args=connection_args
|
|
1082
|
+
)
|
|
1083
|
+
status = handler.check_connection()
|
|
1084
|
+
if status.copy_storage:
|
|
1085
|
+
storage = handler.handler_storage.export_files()
|
|
1086
|
+
except Exception as e:
|
|
1087
|
+
status.error_message = str(e)
|
|
1088
|
+
|
|
1089
|
+
if status.success is False:
|
|
1090
|
+
raise ExecutorException(f"Can't connect to db: {status.error_message}")
|
|
1091
|
+
|
|
1092
|
+
integration = self.session.integration_controller.get(name)
|
|
1093
|
+
if integration is not None:
|
|
1094
|
+
raise EntityExistsError('Database already exists', name)
|
|
1095
|
+
try:
|
|
1096
|
+
integration = ProjectController().get(name=name)
|
|
1097
|
+
except EntityNotExistsError:
|
|
1098
|
+
pass
|
|
1099
|
+
if integration is not None:
|
|
1100
|
+
raise EntityExistsError('Project exists with this name', name)
|
|
1101
|
+
|
|
1102
|
+
self.session.integration_controller.add(name, engine, connection_args)
|
|
1103
|
+
if storage:
|
|
1104
|
+
handler = self.session.integration_controller.get_data_handler(name, connect=False)
|
|
1105
|
+
handler.handler_storage.import_files(storage)
|
|
1106
|
+
|
|
1107
|
+
def answer_create_ml_engine(self, name: str, handler: str, params: dict = None, if_not_exists=False):
|
|
1108
|
+
|
|
1109
|
+
integrations = self.session.integration_controller.get_all()
|
|
1110
|
+
if name in integrations:
|
|
1111
|
+
if not if_not_exists:
|
|
1112
|
+
raise EntityExistsError('Integration already exists', name)
|
|
1113
|
+
else:
|
|
1114
|
+
return ExecuteAnswer()
|
|
1115
|
+
|
|
1116
|
+
handler_module_meta = self.session.integration_controller.get_handler_meta(handler)
|
|
1117
|
+
|
|
1118
|
+
if handler_module_meta is None:
|
|
1119
|
+
raise ExecutorException(f"There is no engine '{handler}'")
|
|
1120
|
+
|
|
1121
|
+
params_out = {}
|
|
1122
|
+
if params:
|
|
1123
|
+
for key, value in params.items():
|
|
1124
|
+
# convert ast types to string
|
|
1125
|
+
if isinstance(value, (Constant, Identifier)):
|
|
1126
|
+
value = value.to_string()
|
|
1127
|
+
params_out[key] = value
|
|
1128
|
+
|
|
1129
|
+
try:
|
|
1130
|
+
self.session.integration_controller.add(
|
|
1131
|
+
name=name, engine=handler, connection_args=params_out
|
|
1132
|
+
)
|
|
1133
|
+
except Exception as e:
|
|
1134
|
+
msg = str(e)
|
|
1135
|
+
if type(e) in (ImportError, ModuleNotFoundError):
|
|
1136
|
+
msg = dedent(
|
|
1137
|
+
f"""\
|
|
1138
|
+
The '{handler_module_meta['name']}' handler cannot be used. Reason is:
|
|
1139
|
+
{handler_module_meta['import']['error_message']}
|
|
1140
|
+
"""
|
|
1141
|
+
)
|
|
1142
|
+
is_cloud = self.session.config.get("cloud", False)
|
|
1143
|
+
if is_cloud is False and "No module named" in handler_module_meta['import']['error_message']:
|
|
1144
|
+
logger.info(get_handler_install_message(handler_module_meta['name']))
|
|
1145
|
+
ast_drop = DropMLEngine(name=Identifier(name))
|
|
1146
|
+
self.answer_drop_ml_engine(ast_drop)
|
|
1147
|
+
logger.info(msg)
|
|
1148
|
+
raise ExecutorException(msg)
|
|
1149
|
+
|
|
1150
|
+
return ExecuteAnswer()
|
|
1151
|
+
|
|
1152
|
+
def answer_drop_ml_engine(self, statement: ASTNode):
|
|
1153
|
+
name = statement.name.parts[-1]
|
|
1154
|
+
integrations = self.session.integration_controller.get_all()
|
|
1155
|
+
if name not in integrations:
|
|
1156
|
+
if not statement.if_exists:
|
|
1157
|
+
raise EntityNotExistsError('Integration does not exists', name)
|
|
1158
|
+
else:
|
|
1159
|
+
return ExecuteAnswer()
|
|
1160
|
+
self.session.integration_controller.delete(name)
|
|
1161
|
+
return ExecuteAnswer()
|
|
1162
|
+
|
|
1163
|
+
def answer_create_database(self, statement: ASTNode):
|
|
1164
|
+
"""create new handler (datasource/integration in old terms)
|
|
1165
|
+
Args:
|
|
1166
|
+
statement (ASTNode): data for creating database/project
|
|
1167
|
+
"""
|
|
1168
|
+
|
|
1169
|
+
if len(statement.name.parts) != 1:
|
|
1170
|
+
raise Exception("Database name should contain only 1 part.")
|
|
1171
|
+
|
|
1172
|
+
database_name = statement.name.parts[0]
|
|
1173
|
+
engine = statement.engine
|
|
1174
|
+
if engine is None:
|
|
1175
|
+
engine = "mindsdb"
|
|
1176
|
+
engine = engine.lower()
|
|
1177
|
+
connection_args = statement.parameters
|
|
1178
|
+
|
|
1179
|
+
if engine == "mindsdb":
|
|
1180
|
+
try:
|
|
1181
|
+
ProjectController().add(database_name)
|
|
1182
|
+
except EntityExistsError:
|
|
1183
|
+
if statement.if_not_exists is False:
|
|
1184
|
+
raise
|
|
1185
|
+
else:
|
|
1186
|
+
try:
|
|
1187
|
+
self._create_integration(database_name, engine, connection_args)
|
|
1188
|
+
except EntityExistsError:
|
|
1189
|
+
if getattr(statement, "if_not_exists", False) is False:
|
|
1190
|
+
raise
|
|
1191
|
+
|
|
1192
|
+
return ExecuteAnswer()
|
|
1193
|
+
|
|
1194
|
+
def answer_drop_database(self, statement):
|
|
1195
|
+
if len(statement.name.parts) != 1:
|
|
1196
|
+
raise Exception("Database name should contain only 1 part.")
|
|
1197
|
+
db_name = statement.name.parts[0]
|
|
1198
|
+
try:
|
|
1199
|
+
self.session.database_controller.delete(db_name)
|
|
1200
|
+
except EntityNotExistsError:
|
|
1201
|
+
if statement.if_exists is not True:
|
|
1202
|
+
raise
|
|
1203
|
+
return ExecuteAnswer()
|
|
1204
|
+
|
|
1205
|
+
def answer_drop_tables(self, statement, database_name):
|
|
1206
|
+
"""answer on 'drop table [if exists] {name}'
|
|
1207
|
+
Args:
|
|
1208
|
+
statement: ast
|
|
1209
|
+
"""
|
|
1210
|
+
|
|
1211
|
+
for table in statement.tables:
|
|
1212
|
+
if len(table.parts) > 1:
|
|
1213
|
+
db_name = table.parts[0]
|
|
1214
|
+
table = Identifier(parts=table.parts[1:])
|
|
1215
|
+
else:
|
|
1216
|
+
db_name = database_name
|
|
1217
|
+
|
|
1218
|
+
dn = self.session.datahub[db_name]
|
|
1219
|
+
if db_name is not None:
|
|
1220
|
+
dn.drop_table(table, if_exists=statement.if_exists)
|
|
1221
|
+
|
|
1222
|
+
elif db_name in self.session.database_controller.get_dict(filter_type="project"):
|
|
1223
|
+
# TODO do we need feature: delete object from project via drop table?
|
|
1224
|
+
|
|
1225
|
+
project = self.session.database_controller.get_project(db_name)
|
|
1226
|
+
project_tables = {
|
|
1227
|
+
key: val
|
|
1228
|
+
for key, val in project.get_tables().items()
|
|
1229
|
+
if val.get("deletable") is True
|
|
1230
|
+
}
|
|
1231
|
+
table_name = table.to_string()
|
|
1232
|
+
|
|
1233
|
+
if table_name in project_tables:
|
|
1234
|
+
self.session.model_controller.delete_model(
|
|
1235
|
+
table_name, project_name=db_name
|
|
1236
|
+
)
|
|
1237
|
+
elif statement.if_exists is False:
|
|
1238
|
+
raise ExecutorException(
|
|
1239
|
+
f"Cannot delete a table from database '{db_name}': table does not exists"
|
|
1240
|
+
)
|
|
1241
|
+
else:
|
|
1242
|
+
raise ExecutorException(
|
|
1243
|
+
f"Cannot delete a table from database '{db_name}'"
|
|
1244
|
+
)
|
|
1245
|
+
|
|
1246
|
+
return ExecuteAnswer()
|
|
1247
|
+
|
|
1248
|
+
def answer_create_view(self, statement, database_name):
|
|
1249
|
+
project_name = database_name
|
|
1250
|
+
# TEMP
|
|
1251
|
+
if isinstance(statement.name, Identifier):
|
|
1252
|
+
parts = statement.name.parts
|
|
1253
|
+
else:
|
|
1254
|
+
parts = statement.name.split(".")
|
|
1255
|
+
|
|
1256
|
+
view_name = parts[-1]
|
|
1257
|
+
if len(parts) == 2:
|
|
1258
|
+
project_name = parts[0]
|
|
1259
|
+
|
|
1260
|
+
query_str = statement.query_str
|
|
1261
|
+
query = parse_sql(query_str)
|
|
1262
|
+
|
|
1263
|
+
if isinstance(statement.from_table, Identifier):
|
|
1264
|
+
query = Select(
|
|
1265
|
+
targets=[Star()],
|
|
1266
|
+
from_table=NativeQuery(
|
|
1267
|
+
integration=statement.from_table, query=statement.query_str
|
|
1268
|
+
),
|
|
1269
|
+
)
|
|
1270
|
+
query_str = str(query)
|
|
1271
|
+
|
|
1272
|
+
if isinstance(query, Select):
|
|
1273
|
+
# check create view sql
|
|
1274
|
+
query.limit = Constant(1)
|
|
1275
|
+
|
|
1276
|
+
query_context_controller.set_context(
|
|
1277
|
+
query_context_controller.IGNORE_CONTEXT
|
|
1278
|
+
)
|
|
1279
|
+
try:
|
|
1280
|
+
sqlquery = SQLQuery(query, session=self.session, database=database_name)
|
|
1281
|
+
if sqlquery.fetch()["success"] is not True:
|
|
1282
|
+
raise ExecutorException("Wrong view query")
|
|
1283
|
+
finally:
|
|
1284
|
+
query_context_controller.release_context(
|
|
1285
|
+
query_context_controller.IGNORE_CONTEXT
|
|
1286
|
+
)
|
|
1287
|
+
|
|
1288
|
+
project = self.session.database_controller.get_project(project_name)
|
|
1289
|
+
try:
|
|
1290
|
+
project.create_view(view_name, query=query_str)
|
|
1291
|
+
except EntityExistsError:
|
|
1292
|
+
if getattr(statement, "if_not_exists", False) is False:
|
|
1293
|
+
raise
|
|
1294
|
+
return ExecuteAnswer()
|
|
1295
|
+
|
|
1296
|
+
def answer_drop_view(self, statement, database_name):
|
|
1297
|
+
names = statement.names
|
|
1298
|
+
|
|
1299
|
+
for name in names:
|
|
1300
|
+
view_name = name.parts[-1]
|
|
1301
|
+
if len(name.parts) > 1:
|
|
1302
|
+
db_name = name.parts[0]
|
|
1303
|
+
else:
|
|
1304
|
+
db_name = database_name
|
|
1305
|
+
project = self.session.database_controller.get_project(db_name)
|
|
1306
|
+
|
|
1307
|
+
try:
|
|
1308
|
+
project.drop_view(view_name)
|
|
1309
|
+
except EntityNotExistsError:
|
|
1310
|
+
if statement.if_exists is not True:
|
|
1311
|
+
raise
|
|
1312
|
+
|
|
1313
|
+
return ExecuteAnswer()
|
|
1314
|
+
|
|
1315
|
+
def answer_create_kb(self, statement: CreateKnowledgeBase, database_name: str):
|
|
1316
|
+
project_name = (
|
|
1317
|
+
statement.name.parts[0]
|
|
1318
|
+
if len(statement.name.parts) > 1
|
|
1319
|
+
else database_name
|
|
1320
|
+
)
|
|
1321
|
+
|
|
1322
|
+
if statement.storage is not None:
|
|
1323
|
+
if len(statement.storage.parts) != 2:
|
|
1324
|
+
raise ExecutorException(
|
|
1325
|
+
f"Invalid vectordatabase table name: {statement.storage}"
|
|
1326
|
+
"Need the form 'database_name.table_name'"
|
|
1327
|
+
)
|
|
1328
|
+
|
|
1329
|
+
if statement.from_query is not None:
|
|
1330
|
+
# TODO: implement this
|
|
1331
|
+
raise ExecutorException(
|
|
1332
|
+
"Create a knowledge base from a select is not supported yet"
|
|
1333
|
+
)
|
|
1334
|
+
|
|
1335
|
+
kb_name = statement.name.parts[-1]
|
|
1336
|
+
|
|
1337
|
+
# create the knowledge base
|
|
1338
|
+
_ = self.session.kb_controller.add(
|
|
1339
|
+
name=kb_name,
|
|
1340
|
+
project_name=project_name,
|
|
1341
|
+
embedding_model=statement.model,
|
|
1342
|
+
storage=statement.storage,
|
|
1343
|
+
params=statement.params,
|
|
1344
|
+
if_not_exists=statement.if_not_exists,
|
|
1345
|
+
)
|
|
1346
|
+
|
|
1347
|
+
return ExecuteAnswer()
|
|
1348
|
+
|
|
1349
|
+
def answer_drop_kb(self, statement: DropKnowledgeBase, database_name: str):
|
|
1350
|
+
name = statement.name.parts[-1]
|
|
1351
|
+
project_name = (
|
|
1352
|
+
statement.name.parts[0]
|
|
1353
|
+
if len(statement.name.parts) > 1
|
|
1354
|
+
else database_name
|
|
1355
|
+
)
|
|
1356
|
+
|
|
1357
|
+
# delete the knowledge base
|
|
1358
|
+
self.session.kb_controller.delete(
|
|
1359
|
+
name=name,
|
|
1360
|
+
project_name=project_name,
|
|
1361
|
+
if_exists=statement.if_exists,
|
|
1362
|
+
)
|
|
1363
|
+
|
|
1364
|
+
return ExecuteAnswer()
|
|
1365
|
+
|
|
1366
|
+
def answer_create_skill(self, statement, database_name):
|
|
1367
|
+
name = statement.name.parts[-1]
|
|
1368
|
+
project_name = (
|
|
1369
|
+
statement.name.parts[0]
|
|
1370
|
+
if len(statement.name.parts) > 1
|
|
1371
|
+
else database_name
|
|
1372
|
+
)
|
|
1373
|
+
|
|
1374
|
+
try:
|
|
1375
|
+
_ = self.session.skills_controller.add_skill(
|
|
1376
|
+
name,
|
|
1377
|
+
project_name,
|
|
1378
|
+
statement.type,
|
|
1379
|
+
statement.params
|
|
1380
|
+
)
|
|
1381
|
+
except ValueError as e:
|
|
1382
|
+
# Project does not exist or skill already exists.
|
|
1383
|
+
raise ExecutorException(str(e))
|
|
1384
|
+
|
|
1385
|
+
return ExecuteAnswer()
|
|
1386
|
+
|
|
1387
|
+
def answer_drop_skill(self, statement, database_name):
|
|
1388
|
+
name = statement.name.parts[-1]
|
|
1389
|
+
project_name = (
|
|
1390
|
+
statement.name.parts[0]
|
|
1391
|
+
if len(statement.name.parts) > 1
|
|
1392
|
+
else database_name
|
|
1393
|
+
)
|
|
1394
|
+
|
|
1395
|
+
try:
|
|
1396
|
+
self.session.skills_controller.delete_skill(name, project_name)
|
|
1397
|
+
except ValueError as e:
|
|
1398
|
+
# Project does not exist or skill does not exist.
|
|
1399
|
+
raise ExecutorException(str(e))
|
|
1400
|
+
|
|
1401
|
+
return ExecuteAnswer()
|
|
1402
|
+
|
|
1403
|
+
def answer_update_skill(self, statement, database_name):
|
|
1404
|
+
name = statement.name.parts[-1]
|
|
1405
|
+
project_name = (
|
|
1406
|
+
statement.name.parts[0]
|
|
1407
|
+
if len(statement.name.parts) > 1
|
|
1408
|
+
else database_name
|
|
1409
|
+
)
|
|
1410
|
+
|
|
1411
|
+
type = statement.params.pop('type', None)
|
|
1412
|
+
try:
|
|
1413
|
+
_ = self.session.skills_controller.update_skill(
|
|
1414
|
+
name,
|
|
1415
|
+
project_name=project_name,
|
|
1416
|
+
type=type,
|
|
1417
|
+
params=statement.params
|
|
1418
|
+
)
|
|
1419
|
+
except ValueError as e:
|
|
1420
|
+
# Project does not exist or skill does not exist.
|
|
1421
|
+
raise ExecutorException(str(e))
|
|
1422
|
+
|
|
1423
|
+
return ExecuteAnswer()
|
|
1424
|
+
|
|
1425
|
+
def answer_create_agent(self, statement, database_name):
|
|
1426
|
+
name = statement.name.parts[-1]
|
|
1427
|
+
project_name = (
|
|
1428
|
+
statement.name.parts[0]
|
|
1429
|
+
if len(statement.name.parts) > 1
|
|
1430
|
+
else database_name
|
|
1431
|
+
)
|
|
1432
|
+
|
|
1433
|
+
skills = statement.params.pop('skills', [])
|
|
1434
|
+
provider = statement.params.pop('provider', None)
|
|
1435
|
+
try:
|
|
1436
|
+
_ = self.session.agents_controller.add_agent(
|
|
1437
|
+
name=name,
|
|
1438
|
+
project_name=project_name,
|
|
1439
|
+
model_name=statement.model,
|
|
1440
|
+
skills=skills,
|
|
1441
|
+
provider=provider,
|
|
1442
|
+
params=statement.params
|
|
1443
|
+
)
|
|
1444
|
+
except ValueError as e:
|
|
1445
|
+
# Project does not exist or agent already exists.
|
|
1446
|
+
raise ExecutorException(str(e))
|
|
1447
|
+
|
|
1448
|
+
return ExecuteAnswer()
|
|
1449
|
+
|
|
1450
|
+
def answer_drop_agent(self, statement, database_name):
|
|
1451
|
+
name = statement.name.parts[-1]
|
|
1452
|
+
project_name = (
|
|
1453
|
+
statement.name.parts[0]
|
|
1454
|
+
if len(statement.name.parts) > 1
|
|
1455
|
+
else database_name
|
|
1456
|
+
)
|
|
1457
|
+
|
|
1458
|
+
try:
|
|
1459
|
+
self.session.agents_controller.delete_agent(name, project_name)
|
|
1460
|
+
except ValueError as e:
|
|
1461
|
+
# Project does not exist or agent does not exist.
|
|
1462
|
+
raise ExecutorException(str(e))
|
|
1463
|
+
|
|
1464
|
+
return ExecuteAnswer()
|
|
1465
|
+
|
|
1466
|
+
def answer_update_agent(self, statement, database_name):
|
|
1467
|
+
name = statement.name.parts[-1]
|
|
1468
|
+
project_name = (
|
|
1469
|
+
statement.name.parts[0]
|
|
1470
|
+
if len(statement.name.parts) > 1
|
|
1471
|
+
else database_name
|
|
1472
|
+
)
|
|
1473
|
+
|
|
1474
|
+
model = statement.params.pop('model', None)
|
|
1475
|
+
skills_to_add = statement.params.pop('skills_to_add', [])
|
|
1476
|
+
skills_to_remove = statement.params.pop('skills_to_remove', [])
|
|
1477
|
+
try:
|
|
1478
|
+
_ = self.session.agents_controller.update_agent(
|
|
1479
|
+
name,
|
|
1480
|
+
project_name=project_name,
|
|
1481
|
+
model_name=model,
|
|
1482
|
+
skills_to_add=skills_to_add,
|
|
1483
|
+
skills_to_remove=skills_to_remove,
|
|
1484
|
+
params=statement.params
|
|
1485
|
+
)
|
|
1486
|
+
except (EntityExistsError, EntityNotExistsError, ValueError) as e:
|
|
1487
|
+
# Project does not exist or agent does not exist.
|
|
1488
|
+
raise ExecutorException(str(e))
|
|
1489
|
+
|
|
1490
|
+
return ExecuteAnswer()
|
|
1491
|
+
|
|
1492
|
+
@mark_process("learn")
|
|
1493
|
+
def answer_create_predictor(self, statement: CreatePredictor, database_name):
|
|
1494
|
+
integration_name = database_name
|
|
1495
|
+
|
|
1496
|
+
# allow creation in non-active projects, e.g. 'create mode proj.model' works whether `proj` is active or not
|
|
1497
|
+
if len(statement.name.parts) > 1:
|
|
1498
|
+
integration_name = statement.name.parts[0]
|
|
1499
|
+
model_name = statement.name.parts[-1]
|
|
1500
|
+
statement.name.parts = [integration_name.lower(), model_name]
|
|
1501
|
+
|
|
1502
|
+
ml_integration_name = "lightwood" # default
|
|
1503
|
+
if statement.using is not None:
|
|
1504
|
+
# repack using with lower names
|
|
1505
|
+
statement.using = {k.lower(): v for k, v in statement.using.items()}
|
|
1506
|
+
|
|
1507
|
+
ml_integration_name = statement.using.pop("engine", ml_integration_name)
|
|
1508
|
+
|
|
1509
|
+
if statement.query_str is not None and statement.integration_name is None:
|
|
1510
|
+
# set to current project
|
|
1511
|
+
statement.integration_name = Identifier(database_name)
|
|
1512
|
+
|
|
1513
|
+
try:
|
|
1514
|
+
ml_handler = self.session.integration_controller.get_ml_handler(
|
|
1515
|
+
ml_integration_name
|
|
1516
|
+
)
|
|
1517
|
+
except EntityNotExistsError:
|
|
1518
|
+
# not exist, try to create it with same name as handler
|
|
1519
|
+
self.answer_create_ml_engine(ml_integration_name, handler=ml_integration_name)
|
|
1520
|
+
|
|
1521
|
+
ml_handler = self.session.integration_controller.get_ml_handler(
|
|
1522
|
+
ml_integration_name
|
|
1523
|
+
)
|
|
1524
|
+
|
|
1525
|
+
if getattr(statement, "is_replace", False) is True:
|
|
1526
|
+
# try to delete
|
|
1527
|
+
try:
|
|
1528
|
+
self.session.model_controller.delete_model(
|
|
1529
|
+
model_name,
|
|
1530
|
+
project_name=integration_name
|
|
1531
|
+
)
|
|
1532
|
+
except EntityNotExistsError:
|
|
1533
|
+
pass
|
|
1534
|
+
|
|
1535
|
+
try:
|
|
1536
|
+
df = self.session.model_controller.create_model(statement, ml_handler)
|
|
1537
|
+
|
|
1538
|
+
return ExecuteAnswer(data=ResultSet().from_df(df))
|
|
1539
|
+
except EntityExistsError:
|
|
1540
|
+
if getattr(statement, "if_not_exists", False) is True:
|
|
1541
|
+
return ExecuteAnswer()
|
|
1542
|
+
raise
|
|
1543
|
+
|
|
1544
|
+
def answer_show_columns(
|
|
1545
|
+
self,
|
|
1546
|
+
target: Identifier,
|
|
1547
|
+
where: Optional[Operation] = None,
|
|
1548
|
+
like: Optional[str] = None,
|
|
1549
|
+
is_full=False,
|
|
1550
|
+
database_name=None,
|
|
1551
|
+
):
|
|
1552
|
+
if len(target.parts) > 1:
|
|
1553
|
+
db = target.parts[0]
|
|
1554
|
+
elif isinstance(database_name, str) and len(database_name) > 0:
|
|
1555
|
+
db = database_name
|
|
1556
|
+
else:
|
|
1557
|
+
db = "mindsdb"
|
|
1558
|
+
table_name = target.parts[-1]
|
|
1559
|
+
|
|
1560
|
+
new_where = BinaryOperation(
|
|
1561
|
+
"and",
|
|
1562
|
+
args=[
|
|
1563
|
+
BinaryOperation("=", args=[Identifier("TABLE_SCHEMA"), Constant(db)]),
|
|
1564
|
+
BinaryOperation(
|
|
1565
|
+
"=", args=[Identifier("TABLE_NAME"), Constant(table_name)]
|
|
1566
|
+
),
|
|
1567
|
+
],
|
|
1568
|
+
)
|
|
1569
|
+
if where is not None:
|
|
1570
|
+
new_where = BinaryOperation("and", args=[new_where, where])
|
|
1571
|
+
if like is not None:
|
|
1572
|
+
like = BinaryOperation("like", args=[Identifier("View"), Constant(like)])
|
|
1573
|
+
new_where = BinaryOperation("and", args=[new_where, like])
|
|
1574
|
+
|
|
1575
|
+
targets = [
|
|
1576
|
+
Identifier("COLUMN_NAME", alias=Identifier("Field")),
|
|
1577
|
+
Identifier("COLUMN_TYPE", alias=Identifier("Type")),
|
|
1578
|
+
Identifier("IS_NULLABLE", alias=Identifier("Null")),
|
|
1579
|
+
Identifier("COLUMN_KEY", alias=Identifier("Key")),
|
|
1580
|
+
Identifier("COLUMN_DEFAULT", alias=Identifier("Default")),
|
|
1581
|
+
Identifier("EXTRA", alias=Identifier("Extra")),
|
|
1582
|
+
]
|
|
1583
|
+
if is_full:
|
|
1584
|
+
targets.extend(
|
|
1585
|
+
[
|
|
1586
|
+
Constant("COLLATION", alias=Identifier("Collation")),
|
|
1587
|
+
Constant("PRIVILEGES", alias=Identifier("Privileges")),
|
|
1588
|
+
Constant("COMMENT", alias=Identifier("Comment")),
|
|
1589
|
+
]
|
|
1590
|
+
)
|
|
1591
|
+
new_statement = Select(
|
|
1592
|
+
targets=targets,
|
|
1593
|
+
from_table=Identifier(parts=["information_schema", "COLUMNS"]),
|
|
1594
|
+
where=new_where,
|
|
1595
|
+
)
|
|
1596
|
+
|
|
1597
|
+
query = SQLQuery(new_statement, session=self.session, database=database_name)
|
|
1598
|
+
return self.answer_select(query)
|
|
1599
|
+
|
|
1600
|
+
def answer_single_row_select(self, statement, database_name):
|
|
1601
|
+
|
|
1602
|
+
def adapt_query(node, is_table, **kwargs):
|
|
1603
|
+
if is_table:
|
|
1604
|
+
return
|
|
1605
|
+
|
|
1606
|
+
if isinstance(node, Identifier):
|
|
1607
|
+
if node.parts[-1].lower() == "session_user":
|
|
1608
|
+
return Constant(self.session.username, alias=node)
|
|
1609
|
+
if node.parts[-1].lower() == '$$':
|
|
1610
|
+
# NOTE: sinve version 9.0 mysql client sends query 'select $$'.
|
|
1611
|
+
# Connection can be continued only if answer is parse error.
|
|
1612
|
+
raise ErParseError(
|
|
1613
|
+
"You have an error in your SQL syntax; check the manual that corresponds to your server "
|
|
1614
|
+
"version for the right syntax to use near '$$' at line 1"
|
|
1615
|
+
)
|
|
1616
|
+
|
|
1617
|
+
if isinstance(node, Function):
|
|
1618
|
+
function_name = node.op.lower()
|
|
1619
|
+
|
|
1620
|
+
functions_results = {
|
|
1621
|
+
"database": database_name,
|
|
1622
|
+
"current_user": self.session.username,
|
|
1623
|
+
"user": self.session.username,
|
|
1624
|
+
"version": "8.0.17",
|
|
1625
|
+
"current_schema": "public",
|
|
1626
|
+
"connection_id": self.context.get('connection_id')
|
|
1627
|
+
}
|
|
1628
|
+
if function_name in functions_results:
|
|
1629
|
+
return Constant(functions_results[function_name], alias=Identifier(parts=[function_name]))
|
|
1630
|
+
|
|
1631
|
+
if isinstance(node, Variable):
|
|
1632
|
+
var_name = node.value
|
|
1633
|
+
column_name = f"@@{var_name}"
|
|
1634
|
+
result = SERVER_VARIABLES.get(column_name)
|
|
1635
|
+
if result is None:
|
|
1636
|
+
logger.error(f"Unknown variable: {column_name}")
|
|
1637
|
+
raise Exception(f"Unknown variable '{var_name}'")
|
|
1638
|
+
else:
|
|
1639
|
+
return Constant(result[0], alias=Identifier(parts=[column_name]))
|
|
1640
|
+
|
|
1641
|
+
query_traversal(statement, adapt_query)
|
|
1642
|
+
|
|
1643
|
+
statement.from_table = Identifier('t')
|
|
1644
|
+
df = query_df(pd.DataFrame([[0]]), statement, session=self.session)
|
|
1645
|
+
|
|
1646
|
+
return ExecuteAnswer(
|
|
1647
|
+
data=ResultSet().from_df(df, table_name="")
|
|
1648
|
+
)
|
|
1649
|
+
|
|
1650
|
+
def answer_show_create_table(self, table):
|
|
1651
|
+
columns = [
|
|
1652
|
+
Column(table_name="", name="Table", type=TYPES.MYSQL_TYPE_VAR_STRING),
|
|
1653
|
+
Column(
|
|
1654
|
+
table_name="", name="Create Table", type=TYPES.MYSQL_TYPE_VAR_STRING
|
|
1655
|
+
),
|
|
1656
|
+
]
|
|
1657
|
+
return ExecuteAnswer(
|
|
1658
|
+
data=ResultSet(
|
|
1659
|
+
columns=columns,
|
|
1660
|
+
values=[[table, f"create table {table} ()"]],
|
|
1661
|
+
)
|
|
1662
|
+
)
|
|
1663
|
+
|
|
1664
|
+
def answer_function_status(self):
|
|
1665
|
+
columns = [
|
|
1666
|
+
Column(
|
|
1667
|
+
name="Db",
|
|
1668
|
+
alias="Db",
|
|
1669
|
+
table_name="schemata",
|
|
1670
|
+
table_alias="ROUTINES",
|
|
1671
|
+
type="str",
|
|
1672
|
+
database="mysql",
|
|
1673
|
+
charset=self.charset_text_type,
|
|
1674
|
+
),
|
|
1675
|
+
Column(
|
|
1676
|
+
name="Db",
|
|
1677
|
+
alias="Db",
|
|
1678
|
+
table_name="routines",
|
|
1679
|
+
table_alias="ROUTINES",
|
|
1680
|
+
type="str",
|
|
1681
|
+
database="mysql",
|
|
1682
|
+
charset=self.charset_text_type,
|
|
1683
|
+
),
|
|
1684
|
+
Column(
|
|
1685
|
+
name="Type",
|
|
1686
|
+
alias="Type",
|
|
1687
|
+
table_name="routines",
|
|
1688
|
+
table_alias="ROUTINES",
|
|
1689
|
+
type="str",
|
|
1690
|
+
database="mysql",
|
|
1691
|
+
charset=CHARSET_NUMBERS["utf8_bin"],
|
|
1692
|
+
),
|
|
1693
|
+
Column(
|
|
1694
|
+
name="Definer",
|
|
1695
|
+
alias="Definer",
|
|
1696
|
+
table_name="routines",
|
|
1697
|
+
table_alias="ROUTINES",
|
|
1698
|
+
type="str",
|
|
1699
|
+
database="mysql",
|
|
1700
|
+
charset=CHARSET_NUMBERS["utf8_bin"],
|
|
1701
|
+
),
|
|
1702
|
+
Column(
|
|
1703
|
+
name="Modified",
|
|
1704
|
+
alias="Modified",
|
|
1705
|
+
table_name="routines",
|
|
1706
|
+
table_alias="ROUTINES",
|
|
1707
|
+
type=TYPES.MYSQL_TYPE_TIMESTAMP,
|
|
1708
|
+
database="mysql",
|
|
1709
|
+
charset=CHARSET_NUMBERS["binary"],
|
|
1710
|
+
),
|
|
1711
|
+
Column(
|
|
1712
|
+
name="Created",
|
|
1713
|
+
alias="Created",
|
|
1714
|
+
table_name="routines",
|
|
1715
|
+
table_alias="ROUTINES",
|
|
1716
|
+
type=TYPES.MYSQL_TYPE_TIMESTAMP,
|
|
1717
|
+
database="mysql",
|
|
1718
|
+
charset=CHARSET_NUMBERS["binary"],
|
|
1719
|
+
),
|
|
1720
|
+
Column(
|
|
1721
|
+
name="Security_type",
|
|
1722
|
+
alias="Security_type",
|
|
1723
|
+
table_name="routines",
|
|
1724
|
+
table_alias="ROUTINES",
|
|
1725
|
+
type=TYPES.MYSQL_TYPE_STRING,
|
|
1726
|
+
database="mysql",
|
|
1727
|
+
charset=CHARSET_NUMBERS["utf8_bin"],
|
|
1728
|
+
),
|
|
1729
|
+
Column(
|
|
1730
|
+
name="Comment",
|
|
1731
|
+
alias="Comment",
|
|
1732
|
+
table_name="routines",
|
|
1733
|
+
table_alias="ROUTINES",
|
|
1734
|
+
type=TYPES.MYSQL_TYPE_BLOB,
|
|
1735
|
+
database="mysql",
|
|
1736
|
+
charset=CHARSET_NUMBERS["utf8_bin"],
|
|
1737
|
+
),
|
|
1738
|
+
Column(
|
|
1739
|
+
name="character_set_client",
|
|
1740
|
+
alias="character_set_client",
|
|
1741
|
+
table_name="character_sets",
|
|
1742
|
+
table_alias="ROUTINES",
|
|
1743
|
+
type=TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1744
|
+
database="mysql",
|
|
1745
|
+
charset=self.charset_text_type,
|
|
1746
|
+
),
|
|
1747
|
+
Column(
|
|
1748
|
+
name="collation_connection",
|
|
1749
|
+
alias="collation_connection",
|
|
1750
|
+
table_name="collations",
|
|
1751
|
+
table_alias="ROUTINES",
|
|
1752
|
+
type=TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1753
|
+
database="mysql",
|
|
1754
|
+
charset=self.charset_text_type,
|
|
1755
|
+
),
|
|
1756
|
+
Column(
|
|
1757
|
+
name="Database Collation",
|
|
1758
|
+
alias="Database Collation",
|
|
1759
|
+
table_name="collations",
|
|
1760
|
+
table_alias="ROUTINES",
|
|
1761
|
+
type=TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1762
|
+
database="mysql",
|
|
1763
|
+
charset=self.charset_text_type,
|
|
1764
|
+
),
|
|
1765
|
+
]
|
|
1766
|
+
|
|
1767
|
+
return ExecuteAnswer(data=ResultSet(columns=columns))
|
|
1768
|
+
|
|
1769
|
+
def answer_show_table_status(self, table_name):
|
|
1770
|
+
# NOTE at this moment parsed statement only like `SHOW TABLE STATUS LIKE 'table'`.
|
|
1771
|
+
# NOTE some columns has {'database': 'mysql'}, other not. That correct. This is how real DB sends messages.
|
|
1772
|
+
columns = [
|
|
1773
|
+
{
|
|
1774
|
+
"database": "mysql",
|
|
1775
|
+
"table_name": "tables",
|
|
1776
|
+
"name": "Name",
|
|
1777
|
+
"alias": "Name",
|
|
1778
|
+
"type": TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1779
|
+
"charset": self.charset_text_type,
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
"database": "",
|
|
1783
|
+
"table_name": "tables",
|
|
1784
|
+
"name": "Engine",
|
|
1785
|
+
"alias": "Engine",
|
|
1786
|
+
"type": TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1787
|
+
"charset": self.charset_text_type,
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
"database": "",
|
|
1791
|
+
"table_name": "tables",
|
|
1792
|
+
"name": "Version",
|
|
1793
|
+
"alias": "Version",
|
|
1794
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1795
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1796
|
+
},
|
|
1797
|
+
{
|
|
1798
|
+
"database": "mysql",
|
|
1799
|
+
"table_name": "tables",
|
|
1800
|
+
"name": "Row_format",
|
|
1801
|
+
"alias": "Row_format",
|
|
1802
|
+
"type": TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1803
|
+
"charset": self.charset_text_type,
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
"database": "",
|
|
1807
|
+
"table_name": "tables",
|
|
1808
|
+
"name": "Rows",
|
|
1809
|
+
"alias": "Rows",
|
|
1810
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1811
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
"database": "",
|
|
1815
|
+
"table_name": "tables",
|
|
1816
|
+
"name": "Avg_row_length",
|
|
1817
|
+
"alias": "Avg_row_length",
|
|
1818
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1819
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"database": "",
|
|
1823
|
+
"table_name": "tables",
|
|
1824
|
+
"name": "Data_length",
|
|
1825
|
+
"alias": "Data_length",
|
|
1826
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1827
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
"database": "",
|
|
1831
|
+
"table_name": "tables",
|
|
1832
|
+
"name": "Max_data_length",
|
|
1833
|
+
"alias": "Max_data_length",
|
|
1834
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1835
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
"database": "",
|
|
1839
|
+
"table_name": "tables",
|
|
1840
|
+
"name": "Index_length",
|
|
1841
|
+
"alias": "Index_length",
|
|
1842
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1843
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
"database": "",
|
|
1847
|
+
"table_name": "tables",
|
|
1848
|
+
"name": "Data_free",
|
|
1849
|
+
"alias": "Data_free",
|
|
1850
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1851
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
"database": "",
|
|
1855
|
+
"table_name": "tables",
|
|
1856
|
+
"name": "Auto_increment",
|
|
1857
|
+
"alias": "Auto_increment",
|
|
1858
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1859
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
"database": "",
|
|
1863
|
+
"table_name": "tables",
|
|
1864
|
+
"name": "Create_time",
|
|
1865
|
+
"alias": "Create_time",
|
|
1866
|
+
"type": TYPES.MYSQL_TYPE_TIMESTAMP,
|
|
1867
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1868
|
+
},
|
|
1869
|
+
{
|
|
1870
|
+
"database": "",
|
|
1871
|
+
"table_name": "tables",
|
|
1872
|
+
"name": "Update_time",
|
|
1873
|
+
"alias": "Update_time",
|
|
1874
|
+
"type": TYPES.MYSQL_TYPE_TIMESTAMP,
|
|
1875
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
"database": "",
|
|
1879
|
+
"table_name": "tables",
|
|
1880
|
+
"name": "Check_time",
|
|
1881
|
+
"alias": "Check_time",
|
|
1882
|
+
"type": TYPES.MYSQL_TYPE_TIMESTAMP,
|
|
1883
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
"database": "mysql",
|
|
1887
|
+
"table_name": "tables",
|
|
1888
|
+
"name": "Collation",
|
|
1889
|
+
"alias": "Collation",
|
|
1890
|
+
"type": TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1891
|
+
"charset": self.charset_text_type,
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
"database": "",
|
|
1895
|
+
"table_name": "tables",
|
|
1896
|
+
"name": "Checksum",
|
|
1897
|
+
"alias": "Checksum",
|
|
1898
|
+
"type": TYPES.MYSQL_TYPE_LONGLONG,
|
|
1899
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
"database": "",
|
|
1903
|
+
"table_name": "tables",
|
|
1904
|
+
"name": "Create_options",
|
|
1905
|
+
"alias": "Create_options",
|
|
1906
|
+
"type": TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1907
|
+
"charset": self.charset_text_type,
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
"database": "",
|
|
1911
|
+
"table_name": "tables",
|
|
1912
|
+
"name": "Comment",
|
|
1913
|
+
"alias": "Comment",
|
|
1914
|
+
"type": TYPES.MYSQL_TYPE_BLOB,
|
|
1915
|
+
"charset": self.charset_text_type,
|
|
1916
|
+
},
|
|
1917
|
+
]
|
|
1918
|
+
columns = [Column(**d) for d in columns]
|
|
1919
|
+
data = [
|
|
1920
|
+
[
|
|
1921
|
+
table_name, # Name
|
|
1922
|
+
"InnoDB", # Engine
|
|
1923
|
+
10, # Version
|
|
1924
|
+
"Dynamic", # Row_format
|
|
1925
|
+
1, # Rows
|
|
1926
|
+
16384, # Avg_row_length
|
|
1927
|
+
16384, # Data_length
|
|
1928
|
+
0, # Max_data_length
|
|
1929
|
+
0, # Index_length
|
|
1930
|
+
0, # Data_free
|
|
1931
|
+
None, # Auto_increment
|
|
1932
|
+
datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), # Create_time
|
|
1933
|
+
datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), # Update_time
|
|
1934
|
+
None, # Check_time
|
|
1935
|
+
"utf8mb4_0900_ai_ci", # Collation
|
|
1936
|
+
None, # Checksum
|
|
1937
|
+
"", # Create_options
|
|
1938
|
+
"", # Comment
|
|
1939
|
+
]
|
|
1940
|
+
]
|
|
1941
|
+
return ExecuteAnswer(data=ResultSet(columns=columns, values=data))
|
|
1942
|
+
|
|
1943
|
+
def answer_show_warnings(self):
|
|
1944
|
+
columns = [
|
|
1945
|
+
{
|
|
1946
|
+
"database": "",
|
|
1947
|
+
"table_name": "",
|
|
1948
|
+
"name": "Level",
|
|
1949
|
+
"alias": "Level",
|
|
1950
|
+
"type": TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1951
|
+
"charset": self.charset_text_type,
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
"database": "",
|
|
1955
|
+
"table_name": "",
|
|
1956
|
+
"name": "Code",
|
|
1957
|
+
"alias": "Code",
|
|
1958
|
+
"type": TYPES.MYSQL_TYPE_LONG,
|
|
1959
|
+
"charset": CHARSET_NUMBERS["binary"],
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
"database": "",
|
|
1963
|
+
"table_name": "",
|
|
1964
|
+
"name": "Message",
|
|
1965
|
+
"alias": "Message",
|
|
1966
|
+
"type": TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1967
|
+
"charset": self.charset_text_type,
|
|
1968
|
+
},
|
|
1969
|
+
]
|
|
1970
|
+
columns = [Column(**d) for d in columns]
|
|
1971
|
+
return ExecuteAnswer(data=ResultSet(columns=columns))
|
|
1972
|
+
|
|
1973
|
+
def answer_create_table(self, statement, database_name):
|
|
1974
|
+
SQLQuery(statement, session=self.session, execute=True, database=database_name)
|
|
1975
|
+
return ExecuteAnswer()
|
|
1976
|
+
|
|
1977
|
+
def answer_select(self, query):
|
|
1978
|
+
data = query.fetch()
|
|
1979
|
+
|
|
1980
|
+
return ExecuteAnswer(data=data["result"])
|
|
1981
|
+
|
|
1982
|
+
def answer_update_model_version(self, model_version, database_name):
|
|
1983
|
+
if not isinstance(model_version, Identifier):
|
|
1984
|
+
raise ExecutorException(f'Please define version: {model_version}')
|
|
1985
|
+
|
|
1986
|
+
model_parts = model_version.parts
|
|
1987
|
+
version = model_parts[-1]
|
|
1988
|
+
if version.isdigit():
|
|
1989
|
+
version = int(version)
|
|
1990
|
+
else:
|
|
1991
|
+
raise ExecutorException(f'Unknown version: {version}')
|
|
1992
|
+
|
|
1993
|
+
if len(model_parts) == 3:
|
|
1994
|
+
project_name, model_name = model_parts[:2]
|
|
1995
|
+
elif len(model_parts) == 2:
|
|
1996
|
+
model_name = model_parts[0]
|
|
1997
|
+
project_name = database_name
|
|
1998
|
+
else:
|
|
1999
|
+
raise ExecutorException(f'Unknown model: {model_version}')
|
|
2000
|
+
|
|
2001
|
+
self.session.model_controller.set_model_active_version(project_name, model_name, version)
|
|
2002
|
+
return ExecuteAnswer()
|
|
2003
|
+
|
|
2004
|
+
def answer_drop_model(self, statement, database_name):
|
|
2005
|
+
|
|
2006
|
+
model_parts = statement.name.parts
|
|
2007
|
+
version = None
|
|
2008
|
+
|
|
2009
|
+
# with version?
|
|
2010
|
+
if model_parts[-1].isdigit():
|
|
2011
|
+
version = int(model_parts[-1])
|
|
2012
|
+
model_parts = model_parts[:-1]
|
|
2013
|
+
|
|
2014
|
+
if len(model_parts) == 2:
|
|
2015
|
+
project_name, model_name = model_parts
|
|
2016
|
+
elif len(model_parts) == 1:
|
|
2017
|
+
model_name = model_parts[0]
|
|
2018
|
+
project_name = database_name
|
|
2019
|
+
else:
|
|
2020
|
+
raise ExecutorException(f'Unknown model: {statement.name}')
|
|
2021
|
+
|
|
2022
|
+
if version is not None:
|
|
2023
|
+
# delete version
|
|
2024
|
+
try:
|
|
2025
|
+
self.session.model_controller.delete_model_version(project_name, model_name, version)
|
|
2026
|
+
except EntityNotExistsError as e:
|
|
2027
|
+
if not statement.if_exists:
|
|
2028
|
+
raise e
|
|
2029
|
+
else:
|
|
2030
|
+
# drop model
|
|
2031
|
+
try:
|
|
2032
|
+
project = self.session.database_controller.get_project(project_name)
|
|
2033
|
+
project.drop_model(model_name)
|
|
2034
|
+
except Exception as e:
|
|
2035
|
+
if not statement.if_exists:
|
|
2036
|
+
raise e
|
|
2037
|
+
|
|
2038
|
+
return ExecuteAnswer()
|
|
2039
|
+
|
|
2040
|
+
def change_default_db(self, db_name):
|
|
2041
|
+
# That fix for bug in mssql: it keeps connection for a long time, but after some time mssql can
|
|
2042
|
+
# send packet with COM_INIT_DB=null. In this case keep old database name as default.
|
|
2043
|
+
if db_name != "null":
|
|
2044
|
+
if self.session.database_controller.exists(db_name):
|
|
2045
|
+
self.session.database = db_name
|
|
2046
|
+
else:
|
|
2047
|
+
raise BadDbError(f"Database {db_name} does not exists")
|