One would be forgiven if they mistook DataMgr for abandoned software. After all, I announced work on DataMgr 2.5 back in August of 2009 and come February (now March) of 2013 and still no official release of 2.5 and no word since DataMgr 2.5 Beta 3 was released more than a year ago. Well, that changes here.
DataMgr 2.5 is Gold!
DataMgr 2.5 has been quite stable for some time and I just haven't gotten around to releasing it. My friend, John Whish, (author of the book "ColdFusion ORM") is giving a presentation about DALs (Data Access Layers) including DataMgr and ColdFusion ORM later this week (more about that soon) and that gave me the extra motivation to go ahead and release the thing.
What is DataMgr?
Better yet, attend John's free presentation. I believe he gives a better overview for a smaller investment of time than I do and his opinion is a little less biased than my own.
From CRUD to DAL and ORM in ColdFusion (March 6, 1:00 PM EST)
This will cover both DataMgr and ColdFusion ORM and give some ideas as to their comparative strengths and weaknesses.
It costs nothing but an hour of your time, so if you have any interesting in learning about about DataMgr and/or ColdFusion ORM then you should really attend.
What's New in 2.5
If you are familiar with DataMgr, below is what is new in DataMgr 2.5 (since DataMgr 2.2).
Before reading it, note one thing that has been true of every single release of DataMgr since 1.0: the vast majority of code using DataMgr can upgrade without any change at all. That is still true of this release.
- Filters (and named filters)
- Paging (via an "offset" argument in the getRecords method)
- Paging handling in the database: MS SQL 2005 +, MySQL, Oracle, PostGreSQL
- For all others, the query is sliced in ColdFusion
- Support for managing Indexes
- Optional "fieldlist" argument to limit the data that can be changed while saving data.
- Optional "truncate" argument to automatically truncate data to fit in database while saving data.
- For tables with a simple (single-field) primary keys, the ability to pass a single value into the "data" argument for getRecords() instead of a structure of values.
- New Methods:
- "hasRecords" method for efficient checking of existence of records matching criteria.
- "numRecords" method to see how many records matching criteria.
- New methods to return SQL used internally: getSelectSQL, getFromSQL, getWhereSQL, insertRecordsSQL, updateRecordsSQL. This is very useful with CF_DMQuery.
- Ability to extend DataMgr
- Ability to migrate fields - moving old data to new field names. Handy for renaming fields or easy migration from many-to-one relationship to a many-to-many one.
- New "isDeletable" calculated field available to "getRecords" determines if each record can be deleted based on "onDelete" property of relation fields.
- Ability to exclude columns from multi-row get queries (see useInMultiRecordsets).
- "advsql" argument now available for update methods
- Defaults for init() "datasource" argument:
- Application.datasource, if defined
- empty string (simulated database), otherwise
- Special Date Type setting
- Special="UUID": Set the value of the field to a UUID if no value is passed in on an insert.
- SQL Server: Added support for varchar(max) (and made it the default for LONGVARCHAR).
- New "applyListRelations" method (take tablename,query) for post-calculation of list relations for getRecords() - also useful with CF_DMQuery
- Optional "XmlData" argument to "init" method (calls "loadXml" automatically)
- Ability to check for table existence.
- Improved MS Word cleanup
- Fixed error on ColdFusion 9.0.1
- Better handling of CFML Engine peculiarities
- getDatabaseXml() now always accurately reports just the database schema.
- Relation fields that use themselves now error instead of producing an infinite loop.
- "maxrows" argument now works in Derby
- Some small MS SQL specific improvements
- Several small fixes