SELECT, JOIN and WHERE query questions

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 19, 2008   (RSS)

Re: [msoda] SELECT, JOIN and WHERE query questions

By Dave - December 17, 2008

Joe, Welcome to the CMS Builder forum! :)

As far as the generated code goes, you're right. We've made certain trade offs to make it accessible to non-programmers.

I myself will custom write MySQL queries when it makes sense to do so, such as when I need a lot of optimizations, or complex queries or joins. And lots of other times I'll just use the generated code because it's so fast and easy to do. :)

To answer your questions, there's no way to select limited columns, and very limited join capabilities with getRecords(). I'm adding some more advanced left join features for the next version, but if you're familiar with hand coding MySQL you may still find that easier.

The challenge for us is making a lot of the power of MySQL accessable to non-programmers without having to teach them MySQL. :)

One last note, you can see the queries CMS Builder generates by adding this option:
'debugSql' => true,

Also, there's a list of options for the getRecords() functions in the comments at the top of /lib/viewer_functions.php

And, you can hard code custom column types in the schema files with 'customColumnType'. See /data/schema/uploads.ini.php for an example.

Hope that helps, let me know if you have any other questions or feedback! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] SELECT, JOIN and WHERE query questions

By msoda - December 19, 2008

Thanks for your comments.

I think that, for us, we will use CMS Builder for rapid client interface development and use some of the manual methods you suggest for displaying the public pages. We have nearly finished our first site so we have several query models to work with already.

We'll definitely be using CMS Builder again.