Passionate Development From Journeyman to Master

CFDBINFO rocks

If you aren’t using ORM, do you find yourself hand coding insert update statements on your CFC (or CFM?). Sure you can script a table with SQL Server and use it for your code, but you would still need to hand code the cfqueryparams.

Last week I wrote a few utilities that helped me with my work. One of them is an Insert/update SQL template generator, it produces SQL statements that can be used directly on database (cut and paste the statement to query analizer) or another option is to produce a cfquery statement with its respective cfqueryparams (cut and paste the statement to a CFM or CFC).

Another utility: pick a table name, upload a CSV with values to be inserted/updated to that table. Run the utility, you can choose to have it run immidiatelly on database or have it to produce insert/update SQL statements.

The ability to introspect table and get all the information (meta data?) of the table is really fascinating! This is especially useful for me as at RECRUITadvantage, we have a strict protocol of database operations (SQL scripts have to be approved by the DBAs).

To wrap up, if you are not using ORM, play around with CFDBINFO, maybe it can help you with automating some of your database work.

coldfusion