You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.24.0.txt
+1
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ Other Enhancements
16
16
- :func:`Series.mode` and :func:`DataFrame.mode` now support the ``dropna`` parameter which can be used to specify whether NaN/NaT values should be considered (:issue:`17534`)
17
17
- :func:`to_csv` now supports ``compression`` keyword when a file handle is passed. (:issue:`21227`)
18
18
- :meth:`Index.droplevel` is now implemented also for flat indexes, for compatibility with MultiIndex (:issue:`21115`)
19
+
- :func:`~pandas.DataFrame.to_sql` add parameter ``method`` to control SQL insertion clause (:8953:)
>>> engine.execute("SELECT * FROM integers").fetchall()
2122
2124
[(1,), (None,), (2,)]
2125
+
2126
+
Insertion method:
2127
+
2128
+
.. versionadded:: 0.24.0
2129
+
2130
+
The parameter ``method`` controls the SQL insertion clause used.
2131
+
Possible values are:
2132
+
2133
+
- `'default'`: Uses standard SQL `INSERT` clause
2134
+
- `'multi'`: Pass multiple values in a single `INSERT` clause.
2135
+
It uses a **special** SQL syntax not supported by all backends.
2136
+
This usually provides a big performance for Analytic databases
2137
+
like *Presto* and *Redshit*, but has worse performance for
2138
+
traditional SQL backend if the table contains many columns.
2139
+
For more information check SQLAlchemy `documention <http://docs.sqlalchemy.org/en/latest/core/dml.html?highlight=multivalues#sqlalchemy.sql.expression.Insert.values.params.*args>`__.
2140
+
- callable: with signature `(pd_table, conn, keys, data_iter)`.
2141
+
This can be used to implement more performant insertion based on
0 commit comments