Skip to content

Commit 6d8fb41

Browse files
committed
doc: to_sql docs should mention ADBC #59095
1 parent a5e812d commit 6d8fb41

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

pandas/core/generic.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2779,7 +2779,8 @@ def to_sql(
27792779
----------
27802780
name : str
27812781
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.
27832784
Using SQLAlchemy makes it possible to use any DB supported by that
27842785
library. Legacy support is provided for sqlite3.Connection objects. The user
27852786
is responsible for engine disposal and connection closure for the SQLAlchemy
@@ -2966,6 +2967,24 @@ def to_sql(
29662967
>>> with engine.connect() as conn:
29672968
... conn.execute(text("SELECT * FROM integers")).fetchall()
29682969
[(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
2986+
2987+
29692988
""" # noqa: E501
29702989
from pandas.io import sql
29712990

0 commit comments

Comments
 (0)