Postgres Non-Standard Data Types

34 views
Skip to first unread message

Randy Merrill

unread,
Feb 27, 2010, 1:49:51 PM2/27/10
to cfwh...@googlegroups.com
I was trying to wheels to work with a database that is using a uuid data type but wheels doesn't know what to do with it.

I would like to help make cfwheels work with the non-'standard' data types.

It seems a trivial thing to add it to the $getType function. But then you also have to do some type conversion since you can't just use stand-alone normal queryparam.

For instance, instead of doing:

<cfqueryparam cfsqltype="cf_sql_varchar" value="#createUUID()#" />

you would need to do:

<cfqueryparam cfsqltype="cf_sql_varchar" value="#createUUID()#" />::uuid

So, my questions:
  • Is there already something in cfwheels that handles this?
  • If I wanted to add the functionality, would a function like $getDataType fit in?
--
Randy Merrill

Chris Peters

unread,
Feb 27, 2010, 3:02:26 PM2/27/10
to cfwh...@googlegroups.com
It wouldn't instead be this?
<cfqueryparam cfsqltype="cf_sql_varchar" value="#createUUID()#::uuid" />

Sorry, not very familiar with Postgres.

You can submit a bug (and even a tested SVN patch if you're daring!) here:
http://code.google.com/p/cfwheels/issues/list

--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.

Andy Bellenie

unread,
Feb 27, 2010, 3:46:37 PM2/27/10
to cfwh...@googlegroups.com
I use MS-SQL GUIDs all the time with Wheels as a primary key without
any issues. What DB are you using and what's the specific problem?

Note the difference between a UUID and a GUID. I needed to add some
conversion functions to my app first but didn't need to alter Wheels
in any way.

Andy

Randy Merrill

unread,
Feb 27, 2010, 3:58:27 PM2/27/10
to cfwh...@googlegroups.com
@Chris It actually requires it outside of the queryparam for some reason. I had the problem when I first started using postgres coming from MSSQL and MySQL.

@Andy I've used the uuids before doing just straight CF queries and they aren't really a problem, but wheels will need some slight modifications to do the type conversion and to recognize that it uses the cf_sql_varchar type...

Once I get it working right locally I'll submit it as a ticket and a patch/pull request for it.

But for now I'm off to the movies! :)
--
Randy Merrill

Randy Merrill

unread,
Mar 3, 2010, 10:34:43 AM3/3/10
to cfwh...@googlegroups.com
K, here is the ticket for what I had to change to get the uuid datatype working:

Reply all
Reply to author
Forward
0 new messages