diff --git a/superset/db_engine_specs/base.py b/superset/db_engine_specs/base.py index a6b1a6b4b395f..aa30847565d44 100644 --- a/superset/db_engine_specs/base.py +++ b/superset/db_engine_specs/base.py @@ -347,6 +347,7 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods # Does database support join-free timeslot grouping time_groupby_inline = False limit_method = LimitMethod.FORCE_LIMIT + supports_multivalues_insert = False allows_joins = True allows_subqueries = True allows_alias_in_select = True @@ -1283,9 +1284,11 @@ def df_to_sql( catalog=table.catalog, schema=table.schema, ) as engine: - if engine.dialect.supports_multivalues_insert: + if ( + engine.dialect.supports_multivalues_insert + or cls.supports_multivalues_insert + ): to_sql_kwargs["method"] = "multi" - df.to_sql(con=engine, **to_sql_kwargs) @classmethod diff --git a/superset/db_engine_specs/mssql.py b/superset/db_engine_specs/mssql.py index d5cc86c859a7b..464f6cf2b9c8d 100644 --- a/superset/db_engine_specs/mssql.py +++ b/superset/db_engine_specs/mssql.py @@ -53,6 +53,7 @@ class MssqlEngineSpec(BaseEngineSpec): max_column_name_length = 128 allows_cte_in_subquery = False allow_limit_clause = False + supports_multivalues_insert = True _time_grain_expressions = { None: "{col}",