Squidhead

FAQS

What is Squidhead?
Squidhead is a ColdFusion application that creates scaffolds for a SQL database. It creates them using stored procedures instead of inline SQL. It also automatically creates ColdFusion code for user created stored procedures.
Why is it called Squidhead?
My wife told me to call it that. It comes from a fake band name I came up with a while back. I figure the SQ in Squidhead works for something with SQL.
What makes this different from other database scaffolders?
As far as I know, none of the other scaffolders use stored procedures. This both writes and reads stored procedures for the purposes of scaffolding. Additionally, Squidhead introspects using foreign keys, making reference tables very easy to use.
The config calls for database usernames and passwords, but my configuration includes them in the datasource. What do I do?
Set the username and password to an empty string.
Why aren't you making an application.cfc in your generated application?
Because, an application.cfc is a little trickier to make dynamically than an application.cfm. Also I assumed that I would just slap in an application.cfc when I wanted to customize the application. Since an application.cfc overrules an applicaiton.cfm, no one would get hurt.
I don't like the way a particular piece comes out, can I configure them myself?
Sure, you just have to know where to look.
Item to ChangeWhere to edit the code
Stored Procedurescfc/SQLStoredProc.cfc
<cfstoredproc>cfc/mssql/CFstoredProc.cfc
Custom Tagstemplates/cfmltemplates
CFMLtemplates/customtagtemplates
If my Database admins won't let me call direct SQL, why would they let me use this tool since it requires Create and Drop permissions?
Well, you could run it in scripting mode. This will output a SQL script will all of the SQL code to generate the default CRUD procedures. You will have to run that script on the SQL server before you continue with the rest of the application. To do this, set config['settings']['generateSQLScript'] to TRUE. Just make sure that you set config['db']['username'], otherwise, neccessary grant commands will not be created.
How does Squidhead handle outputs?
If the stored procedure returns via a single output variable, then the CFC will return it as the CF variable type that matches the SQL variable type of the output variable. If the store procedure returns via multiple output variables, then it returns a structure of those output variables.
Oh Yeah? How does Squidhead handle multiple queries?
Dude, what's with the 'tude? It detects multiple queries and returns then as a structure of those queries.
I don't like to delete records from the database? So I won't use an auto-crud tool.
If you set config['reservedwords']['active'] to a a value of your choice, then put that value as a bit value column name in a table of your choosing; then Squidhead will build your CRUD stored procedures respecting deactivation versus deletion. (The list function will obey it too.)
What's the XML Disk Cache?
It's an XML Representation of the database structure that Squidhead creates when it analyzes your database. Certain settings in this file override introspected database information.

Currently there are 4 things that setting here will effect:
  1. DisplayName on database columns that will show as labels on all UI components instead of the name. ("First Name" vs f_name).
  2. OrderBy on tables which will alter the order of the default List elements
  3. ForeignKeyLabel the column which will be substituted for the primary key, in all tables that link to this table via foreign keys.
  4. IsImage whether or not a column is an image. Set to true for image columns in MSSql, must be mannually set for blobs that are images in MySQL.
Does Squidhead support foreign keys?
Yes.
Care to elaborate on that?

Form UI - On forms that interact with tables with foreign keys, Squidhead will produce a select box of the aforementioned "foreign key labels."

List and Read UI- These components now call separate stored procedures that properly join the requisite tables to show the appropriate "foreign key label" in lieu of the actual value.

If you use the application template fkCrazy Squidhead will build methods in all of your business objects that allow you to manipulate tables across foreign key linked tables.

How can I run a generated application on ColdFusion 7?

You have to deactivate the ColdFusion 8 specific ui components. To do so add the following lines to your config file:

<!--- These are UI settings for changing the way the ui is rendered --->
<cfset config['ui']['RichTextAreas'] = FALSE />
<cfset config['ui']['DateField'] = FALSE />
<cfset config['ui']['Images'] = FALSE />