Finally, a framework for the rest of us!

CFWheels is an open source CFML (ColdFusion Markup Language) framework inspired by Ruby on Rails that provides fast application development, a great organization system for your code, and is just plain fun to use.

One of our biggest goals is for you to be able to get up and running with CFWheels quickly. We want for you to be able to learn it as rapidly as it is to write applications with it.

Get Started    

Soft Delete

An easy way to keep deleted data in your database.

"Soft delete" in database lingo means that you set a flag on an existing table which indicates that a record has been deleted, instead of actually deleting the record.

How to Use Soft Deletion

If you create a new date column (the column type will depend on your database vendor, but usually you want to use date, datetime, or timestamp) on a table and name it deletedAt, Wheels will automagically start using it to record soft deletes.

Without the soft delete in place, a delete() call on an object will delete the record from the table using a DELETE statement. With the soft delete in place, an UPDATE statement is sent instead (that sets the deletedAt field to the current time).

Of course, all other Wheels functions are smart enough to respect this. So if you use a findAll() function, for example, it will not return any record that has a value set in the deletedAt field.

What this all means is that you're given a convenient way to keep deleted data in your database forever, while having your application function as if the data is not there.

Getting data including Soft Deletes

Occasionally you might want to include data which has been flagged for deletion. You can do this easily by adding includeSoftDeletes=true to any findAll type call.

Obviously, if you have any manual queries in your application, you'll need to remember to add deletedAt IS NULL to the WHERE part of your SQL statements instead.

Updated 2 years ago

Soft Delete


An easy way to keep deleted data in your database.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.