tags:

views:

178

answers:

2

Do any of the available ORMs support using a bit field to represent row removal?

More information. Working in C#. I need to delete this way to support synchronization of remote database changes to a central database. I'm looking for a possible ORM, but am also interested in approaches to the problem. So if anyone knows any ORM in any language/environment that addresses this problem I would be interested in looking at it. Thanks for the questions feel free to ask more if anything is unclear.

+5  A: 

This may not apply if you're not using .NET, but the LightSpeed ORM has a built in feature called "soft delete". Basically, when you have a DeletedOn field on your table LightSpeed will insert the time it was deleted. It automatically handles this on normal selects (e.g. where Deleted == null) so that the deleted items are not seen again. You could then write a sync process that detects the deleted state by checking that field.

You can of course instruct the querying engine to include deleted results.

Mindscape LightSpeed ORM

I am making an assumption also that we're talking about the same thing here :-)

traskjd
Exactly, It seems a common design. Not sure why it's not more wide spread. Thanks for the info.
Brian Clark
A: 

I recommend to implement logical delete externally in your application, cause it's not very complex, but it will be more flexible. See this article for details.

Alex Kofman