DataMgr 2.2 Beta 3 (with Railo support!)
Coming just 6 weeks after the previous beta, DataMgr 2.2 Beta 3 is ready and I expect it is pretty close to the final release.
Improvements:
- New Support: Railo 3.0.1+
- New Method: getDefaultValues()
- New Public Method: getBooleanSqlValue()
- Improved Seeding
- Bug Fixes
New Support: Railo 3.0.1+
I have now gotten DataMgr to run on Railo 3.0.1. The testing that I have done on Railo is not yet extensive, so do let me know if you run into any trouble.
The one caveat to Railo support is that I had to create a new file (DataMgr_railo_query.cfm) that has to be in the same folder as DataMgr in order for DataMgr to work on Railo. This is due to their unusual way of handling PreserveSingleQuotes(). I tried to find a way around it, but I was not able to do so.
So, DataMgr will now run on ColdFusion MX or better and Railo 3.0.1 or better. Open BlueDragon 1.0 was released today, so I will look at adding support for that soon as well.
New Method: getDefaultValues()
This is a result of more great thinking from the mind of John Whish. This method takes the name of a table and returns a structure with a key for every field in the table. Any field with a default of NULL or no default at all will have an empty string. The value for the key for every other field will be the value of the default for that field.
New Public Method: getBooleanSqlValue()
The getBooleanSqlValue() method is not technically new to DataMgr, but until this build the method has been private and now it is public.
The format for boolean values varies a bit from database to database. For example, MS Access will accept yes or no, but most other databases will not. PostGreSQL will only acces true or false, which most other databases won't accept. So, this method returns the boolean value in a format that the current database will support.
While this is already handled internally in DataMgr, public access to this method will help you to achieve cross-database compatibility for any queries that you write by hand.
Improved Seeding
This is an improvement on the feature that I added in the previous beta based on a suggestion from John Farrar. This time, I have improved the functionality to meet John's needs which I had failed to adequately comprehend previously.
This feature will get its own blog entry shortly, but in short if you add a "checkFields" attribute to a "data" element when calling the loadXml() method, you can indicate which fields should be checked to see if the record already exists (otherwise all fields will be checked). The data element can also accept a "onexists" attribute (which defaults to "ignore").
If a record exists, then the "onexists" attribute will be checked. If it is set to "update" then the record will be updated to match the values in the XML. Otherwise, the record will be left as-is.
Bug Fixes
Only a few bugs needed to be fixed for this build.
- Fixed precision/scale
- Fixed bug with DeletionMark on date fields
- More informative error for missing primary keys in getRecord()
- Oracle: Fixed numeric fields
- PostGreSQL: Fixed tables returned by getDatabaseTables() not to return system tables
Download
DataMgr is open source and free for any use. Download 2.2 Beta 3 from the DataMgr page on my site.