DataMgr 2.2 Alpha (with Derby support!)

It has been 6 months since DataMgr 2.1 was released. In that time I have been slowly improving my local copy of DataMgr. I now think that the improvements are ready for public trial. I am running several live sites on the build that I am making public.


Inserting Custom SQL into DataMgr

We ran into a situation on a current project where we needed to return a column based on complicated logic. We needed to have a column that indicated if the value of an answer had changed since the user had originally answered the question. This logic was sufficiently complicated that even a custom relation field wouldn't do the job.

In situations where a layer of abstraction isn't able to handle the complexity required, it makes sense to break out of that layer of abstraction. That is why a ColdFusion programmer may sometimes (rarely) have to revert to Java. For DataMgr, this suggests writing SQL manually in situations like this.

In our case, however, we had already defined several relation fields that we needed to use and we didn't want to have to redefine them (or to ask DataMgr for the SQL for each relation field individually). We needed a way to add a field composed of complex SQL to our query without losing the benefit of our DataMgr relation fields.


Custom Relations Part III: Cascading

Last time I covered how to use custom relations to add a field composed of complicated SQL. The real problem, however, is to reference that field from another table. Fortunately, this problem is easy to solve.


Custom Relations Part II: Complex Logic

A friend of mine called me yesterday with an interesting problem because he was unable to get some data for a record using DataMgr because it would require complicated logic. He didn't want to drop DataMgr because then he would have to write this logic in several places.


Custom Relations Part I: IsNull

I just got an email from someone using DataMgr asking how to use DataMgr to filter by whether or not a field is NULL. This seems like functionality that DataMgr should have (and hopefully will in a future version), but right now it doesn't. It doesn't seem right that this should be the end of the road. Fortunately, you can convince DataMgr to do things it wasn't built to do.


Getting and Filtering Records in DataMgr

In working with a subcontractor, I realized that I have done a poor job so far in providing a simple example of getting and filtering records with DataMgr. DataMgr makes this task very easy, but it does require a little explanation.


NoticeMgr Goes Gold

NoticeMgr allows you to set up dynamic, event driven email so that it can be edited by your users.


Checking for Related Records on Deletion

After covering features, I wanted to share a real-world scenario with DataMgr (Read about DataMgr). In this case, the need to prevent the logical deletion of a record where related records exist.

In this system, we have volunteers and referrals (among other things). We want our administrators to be able to manage the referrals (how volunteers heard about the site). This includes the usual add/edit/delete actions. Except that we don't want them to be able to delete a referral value that is in use. Which is to say that they can't delete a referral that was chosen by a volunteer in the system.


Introduction to Relation Fields

I added relation fields to DataMgr in version 2.0. Upon receiving a question about them by email, I noticed that I haven't ever written a good introduction about how to use them (though I have mentioned them several times).


Schema Synchronization with DataMgr

One common problem that many developers face is Database Schema Synchronization, that is making sure that your database has the right schema (table and columns and whatnot). This is important when moving code from development to production (to avoid a long task list of columns and tables to add) and important for distributed programs (things like BlogCFC that are used in lots of places).

Typically, this is done by writing several SQL scripts the keep the database schema up to date. Then you run the correct script for the next upgrade. Barney Boisvert wrote is SchemaTool to make this easier.

The problem is compounded if you want to support multiple databases. Ideally the SQL syntax should be the same from database to database, but usually it isn't. This means that you also have write separate SQL scripts for each database that you support.

DataMgr solves all of these problems in a manner that I feel is rather elegant.


More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.