marten icon indicating copy to clipboard operation
marten copied to clipboard

Make upsert optional

Open mariusin79 opened this issue 9 years ago • 1 comments

The upsert-functionality is nice, but way to intrusive in some cases. Assuming that inserts and updates are equal operations is an assumption which can't possibly fit all scenarios. A few different suggestions:

  1. Make it possible to opt-out at runtime, session.Store( upsert:false)
  2. Make it possible to opt-out when configuring the document store
  3. Make it possible for the user to make decisions as to how the situation should be handled by a callback instead of the upsert being handled at sql-level (avoid user-transparency)

mariusin79 avatar Jun 19 '17 12:06 mariusin79

@mariusin79,

Mostly a duplicate with #700 -- but having a second person ask for it makes me feel better about having it. This will be in 2.0 within the next week or so. It's an explicitly different operation for pure Inserts or Updates, so IDocumentSession.Insert() or IDocumentSession.Update().

jeremydmiller avatar Jun 19 '17 12:06 jeremydmiller