Skip to content

Conversation

@mroeschke
Copy link
Member

@mroeschke mroeschke commented May 16, 2023

Appears there's no sqlalchemy agnostic way to implement this, but this appears possible with the current method parameter so added a docstring demonstrating it.

@mroeschke mroeschke added Docs IO SQL to_sql, read_sql, read_sql_query labels May 16, 2023
@mroeschke mroeschke added this to the 2.1 milestone May 16, 2023
@mroeschke mroeschke changed the title DOC: Add to_sql example of conflict do nothing DOC: Add to_sql example of conflict with method parameter May 17, 2023
@mroeschke
Copy link
Member Author

Looks like the tests are passing here. Happy to follow up if there are any comments

@mroeschke mroeschke merged commit 947d14f into pandas-dev:main Jun 20, 2023
@mroeschke mroeschke deleted the doc/sql/on_conflict branch June 20, 2023 19:44
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
…ev#53264)

* DOC: Add to_sql example of conflict do nothing

* Use fixture to skip

* Add example of conflict update
@17853535785
Copy link

Hello, here I want to add the value of the original field to the incoming value to get the latest value. How to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs IO SQL to_sql, read_sql, read_sql_query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When using to_sql(), continue if duplicate primary keys are detected? Adding (Insert or update if key exists) option to .to_sql

2 participants