DataMgr 2.0 is Gold!

Data Access Layer, DataMgr 2.0 is finally in full release! It automates CRUD functionality without creating code and supports OO or procedural coding.

Data encompasses three major types of functionality:

  • CRUD: Database reads/writes including those of the type performed by cfinsert/cfupdate
  • ActiveSchema: The ability for your code to define your database structure. DataMgr can introspect the database structure or it can define it.
  • Prototyping: The ability to use simulated data for prototyping (much like QuerySim, but more powerful and less work).

DataMgr is different from other available options because it doesn't generate any code. It isn't an ORM solution, but you could easily build an ORM solution on top of it.

The syntax for using DataMgr is the same for any supported database and you can add support for a new database by adding a new CFC (about 250-300 lines of code, on average). DataMgr currently supports the following:

  • MS Access '97+
  • MySQL 4.1+
  • PostGreSQL 8+
  • SQL Server 2000+ 

If you want to upgrade from DataMgr 1.X, copy the new DataMgr files over the existing DataMgr files and then reload the DataMgr component and any components that use it (usually via ?reinit=1 or some such). No change in syntax is required.

DataMgr only incurs a minimal performance overhead when compared to SQL in cfquery.

Built into DataMgr's CRUD functions are better error handling (no more "String or binary data would be truncated" errors) and automatic conversion of special MS Word characters to their ASCII equivalents.

DataMgr can introspect your database or you can define your table structure and have DataMgr create it. You can even have DataMgr create tables with data.

In addition to the supported databases, you can also use a simulated database. This effectively creates QuerySim-like queries without having to type out any data (using table definitions as above).

DataMgr also include several other features (discussed in the beta release of DataMgr 2.0) which can be seen on the DataMgr demonstration site and are included in the DataMgr documentation.

DataMgr is open source an free for any use and can be downloaded from datamgr.riaforge.org.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Hi Steve,

Congrats! Great to see 2.0 go gold.
# Posted By Peter Bell | 4/9/07 8:31 PM
Thanks Peter!

I am pretty excited about it.
# Posted By Steve Bryant | 4/9/07 10:47 PM
Hi Steve,
i've installed dataMgr2, but i've a problem: in my oop app, i have an object one property of which is another object; to persist the main object i pass its memento, a struct, as argument to insertRecord() method of dataMgr; this memento has a key containing an object so your new dataMgr clean() method return an error: cf cannot duplicate cfc; all was fine with dataMgr 1.0. how can i solve this problem?
regards
salvatore
# Posted By salvatore fusto | 4/12/07 2:11 PM
Salvatore,

Sorry for the trouble on that. I just uploaded a new build that should solve that problem. Let me know how that works for you.
# Posted By Steve Bryant | 4/12/07 2:54 PM
Hi Steve,
i've another question i'm not sure that is depending on your fine tool; i have a bean one property of which is a date: i decided to set this property as type=string; in dataMgr i define the corrisponding field with CF_DataType="CF_SQL_DATE" but i note that if my date, in gg/mm/yyyy, is 11/04/2007, the insertRecord() reverts day and mounth of the date storing 04/11/2007 in the db, but if the day is greater than 12, ie 15/04/2007 all ik ok and the date stored is 15/04/2007.
how can i solve? is this due to dataMgr?
regards
salvatore
# Posted By salvatore fusto | 4/12/07 3:48 PM
Salvatore,

I don't think that is a DataMgr problem, per se. Internally, ColdFusion will store that value as a string. DataMgr uses CreateODBCDateTime() when saving date values to the database.

When ColdFusion sees a string formatted (nn/nn/nnnn), it assumes that to be (mm/dd/yyyy) and converts accordingly.

If I have control over the format of dates that I am passing around internally, I generally prefer that format (yyyy-mm-dd) as that format tends to be consistent regardless of geography, where the interpretation of the (nn/nn/yyyy) format tends to vary based on locale.

Hope that helps.
# Posted By Steve Bryant | 4/12/07 3:57 PM
hi Steve,
do you remember the bug in dataMgr2 about duplicating struct containg a key whose value is acfc? you have changed the clean() method inataMgr.cfc, but the same bug is in the sval() method of dataMgr.cfc, resultingin an error in deleting a record.
can you verify all methods containing a duplicate() function?
regards
salvatore
# Posted By salvatore fusto | 4/13/07 4:23 PM
Salvatore,

I just uploaded version 2.0.2 to RIAForge to hopefully solve that problem.

If you still have trouble, can you send me an email (my first name at my domain name - bryantwebconsulting.com) so that we can work on testing your scenario in detail?

Thanks
# Posted By Steve Bryant | 4/13/07 5:18 PM
Steve,
i already solved: i pass the object to persist to a DAO that instantiates and uses dataMgr.cfc; before, the DAO was calling dataMgr methods passing the memento, the instance struct, of the object, but now i, by using a for-in loop, eliminate all not simple values from memento, ie composed classes.
however i'll download 2.02
thanks a lot and regards
salvatore
# Posted By salvatore fusto | 4/14/07 7:53 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.