File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2779,7 +2779,8 @@ def to_sql(
2779
2779
----------
2780
2780
name : str
2781
2781
Name of SQL table.
2782
- con : sqlalchemy.engine.(Engine or Connection) or sqlite3.Connection
2782
+ con : ADBC connection, sqlalchemy.engine.(Engine or Connection) or sqlite3.Connection
2783
+ ADBC provides high performance I/O with native type support, where available.
2783
2784
Using SQLAlchemy makes it possible to use any DB supported by that
2784
2785
library. Legacy support is provided for sqlite3.Connection objects. The user
2785
2786
is responsible for engine disposal and connection closure for the SQLAlchemy
@@ -2966,6 +2967,22 @@ def to_sql(
2966
2967
>>> with engine.connect() as conn:
2967
2968
... conn.execute(text("SELECT * FROM integers")).fetchall()
2968
2969
[(1,), (None,), (2,)]
2970
+
2971
+ .. versionadded:: 2.2.0
2972
+
2973
+ pandas now supports writing via ADBC drivers
2974
+
2975
+ >>> df = pd.DataFrame({'name' : ['User 10', 'User 11', 'User 12']})
2976
+ >>> df
2977
+ name
2978
+ 0 User 10
2979
+ 1 User 11
2980
+ 2 User 12
2981
+
2982
+ >>> from adbc_driver_sqlite import dbapi # doctest:+SKIP
2983
+ >>> with dbapi.connect("sqlite://") as conn: # doctest:+SKIP
2984
+ ... df.to_sql(name="users", con=conn)
2985
+ 3
2969
2986
""" # noqa: E501
2970
2987
from pandas .io import sql
2971
2988
You can’t perform that action at this time.
0 commit comments