Soft Delete Capability?

Topics: Developer Forum
Aug 24, 2007 at 5:32 PM
Could functionality be added to "soft delete"? One way I have done this in the past is add a new column to every table called IsDeleted (Int) with a default value of 0 and on an actual delete it is set to 1. Any "delete" operation just changes this column value. Every piece of SQL that touches the database must then have "and IsDeleted=0" to return rows, but it makes it easy to undelete or just know what the previous row value was.

How could/would that be done in DbEntry.Net?

Thanks.
Coordinator
Aug 25, 2007 at 3:55 AM
DbEntry.Net doesn't support "soft delete" yet.
So we need to do this manually by now.
I'll think about how to implement it in DbEntry.Net.

Thanks.
Aug 29, 2007 at 2:03 AM
Well, if soft delete is not implemented, what about some kind of automatic echo/logging?

Maybe a boolean overload for deleting to spawn a background thread to save the rows that are about to be deleted.
Coordinator
Aug 29, 2007 at 2:18 PM
Yes, in config file, we can define logger in it:

<add key="SqlLogRecorder" value="org.hanzify.llf.util.Logging.ConsoleMessageRecorder, org.hanzify.llf.util" />
There are some Recorders implements such like ouput to console, save to file, save to DataBase etc.

And you can implements your Recorder to save the information to whatever you want.

In DbEntry, it will log composed SQL in this way, so all ORM SQL will be saved.
Coordinator
Aug 29, 2007 at 2:40 PM
The ORM8 in samples is using logger to output SQLs.
Coordinator
Sep 2, 2007 at 1:13 PM
Soft Delete is done.
Sep 4, 2007 at 1:54 PM
Sorry, I don't understand. Are you saying that "soft delete" as I described in my first post is done, or "delete logging" is done as I described in the second post?

Thanks.
Coordinator
Sep 4, 2007 at 3:23 PM
Edited Sep 4, 2007 at 3:24 PM
Sql logging was done long time ago.

Soft delete just done. Please see Soft Delete. It's not release, but you can download the source code first.