Doctrine Project

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Doctrine 2 - ORM
  • Doctrine 2 - ORM
  • DDC-668

add upsert support

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 2.x
  • Component/s: ORM
  • Security Level: All
  • Labels:
    None

Description

Didnt find anything in the docs on this. Is D2 capable of doing an UPSERT [1] in case I am trying to persist an object that may or may not have been saved previously. Different RDBMS support different syntax for this case. Like MySQL has INSERT .. ON DUPLICATE KEY UPDATE (or even INSERT IGNORE) while the SQL standard defines a MERGE syntax which seems to be gaining support. Of course you can always fallback to a SELECT FOR UPDATE (or if you want to be hacky an INSERT which catches duplicate key violations .. but probably not a good idea since many RDBMS rollback on a failure inside a transaction).

[1] http://en.wikipedia.org/wiki/Upsert

See also http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011 asking for MERGE support

Ideally there would be a way to define on a model or model instance level if merge logic should be applied.

Activity

  • All
  • Comments
  • History
  • Activity
  • Source

People

  • Assignee:
    Benjamin Eberlei
    Reporter:
    Lukas Kahwe
Vote (4)
Watch (3)

Dates

  • Created:
    04/Jul/10 5:20 PM
    Updated:
    20/Dec/11 10:22 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Doctrine Project. Try JIRA - bug tracking software for your team.