Skip to content

Commit

Permalink
docs: include option 'delete_rows'
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcrocetti committed Feb 25, 2025
1 parent 10762c6 commit 077e720
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2788,7 +2788,7 @@ def to_sql(
con,
*,
schema: str | None = None,
if_exists: Literal["fail", "replace", "append"] = "fail",
if_exists: Literal["fail", "replace", "append", "delete_rows"] = "fail",
index: bool = True,
index_label: IndexLabel | None = None,
chunksize: int | None = None,
Expand Down Expand Up @@ -2825,12 +2825,13 @@ def to_sql(
schema : str, optional
Specify the schema (if database flavor supports this). If None, use
default schema.
if_exists : {'fail', 'replace', 'append'}, default 'fail'
if_exists : {'fail', 'replace', 'append', 'delete_rows'}, default 'fail'
How to behave if the table already exists.
* fail: Raise a ValueError.
* replace: Drop the table before inserting new values.
* append: Insert new values to the existing table.
* delete_rows: If a table exists, delete all records and insert data.
index : bool, default True
Write DataFrame index as a column. Uses `index_label` as the column
Expand Down

0 comments on commit 077e720

Please sign in to comment.