Blog

BoxLang Query Of Query Improvements and Additions

Posted by Brad Wood
Jan 13, 2025 20:53:00 UTC

A few days ago, I blogged about how the new Query of Query support in BoxLang has greatly exceeded the performance of Adobe and Lucee's QoQ.  If you haven't read that post, you can find it here:

https://www.codersrevolution.com/blog/boxlangs-qoq-is-here-and-its-5x-faster-than-lucee-17x-faster-than-adobe

I also said we had added a bunch of nice new features to BoxLang's QoQ, which I'll explain today.  We built our QoQ support from scratch using a super fast ANTLR grammar based on SQLite which we customized for our needs.  This gave us a great opportunity to incorporate some of those features out of the box. 

BoxLang's QoQ Is Here, And It's 5x Faster Than Lucee, 17x Faster Than Adobe!

Posted by Brad Wood
Dec 27, 2024 00:00:00 UTC

As BoxLang (our new CF-compatible JVM language) nears its final release, we're very pleased to announce that Query of Query support is ready for testing!  QoQ often times draws a variety of reactions from people, but it's a really nice feature to run any SQL select you want against 1 or more in-memory queries for the purpose of filtering, aggregating, or joining.  One of the biggest complains is performance, which is why I've performed 2 round of performance enhancements to Lucee's QoQ support in the past which I detailed here and here.

Building on the knowledge and experience I got from overhauling Lucee's QoQ, I incorporated those lessons into the architecture of every part of BoxLang's query object, and QoQ implementation.  I'm pleased to have a fully-functional 100% Java implementation of QoQ which supports everything Adobe and Lucee QoQ supports and much more.  We're not using an HSQLDB fallback-- everything is pure Java and super optimized.  I was able to make some big architectural changes since this was being built from the ground-up.

Improving Lucee's QoQ Support Again- now 200% faster

Posted by Brad Wood
Dec 01, 2022 20:12:00 UTC

Two years ago, I published this post detailing how I had refactored the Query of Query support in Lucee to be much better and also much faster:

https://www.codersrevolution.com/blog/improving-lucees-query-of-query-support

I removed the single-threaded HSQLDB callback for grouped/aggregate and distinct selects and tuned the performance.  QoQ's are a bit of a polarizing feature in CFML.  They've suffered in the past from poor support and poor performance which has caused a lot of people to avoid them.  There are certainly places where queryMap(), queryFilter(), and queryReduce() are the best approach, but there are also times where you simply can't beat the readability and conciseness of an ordered,  aggregated select.  I know developers who tell me they never use "reduce" higher order functions because they are too confusing, but I've never met a developer who didn't understand "GROUP BY department"! 

I've got several other ideas to increase the feature set of QoQ in CFML including native support for INNER and OUTER joins as well as this idea of exposing CFML string, number, and date functions directly in QoQ.  I've also put in a handful of tickets for Adobe ColdFusion to invite them to follow in the improvements I've added to Lucee. I'd send them pulls, if I could : (

Detect if a User is Online with RabbitMQ Web Stomp

Posted by Brad Wood
Mar 13, 2021 00:41:00 UTC

We're using RabbitMQ and its Web Stomp plugin for websockets for several projects at work.  Using a Stomp.js library in the browser, our app users connect and subscribe to topics using their username and JWT, which we validate using a custom HTTP back end auth in Rabbit.  I've recently written a rest-over-stomp module for ColdBox MVC which allows you to push the response of any Coldbox event or API call out over a websocket channel to any browser listening on that channel.  This allows for the following

  • Browser can request data and receive it async
  • Any random server-side process can simply decide to push fresh data out to browser
  • Each user subscribes to a custom topic specific to them (via permissions enforced by my custom HTTP backend auth) so I have a direct data bus to any users's browser
  • Unlike Ajax calls, there is no HTTP/TCP negotiation of each request since the websocket is a persistent connection to the server

A quick comparison of using Python and CFML to write the same CLI tool

Posted by Brad Wood
Jan 27, 2021 07:47:00 UTC

A few days ago, Joseph Lamoree posted about a cool little command line tool he wrote in Python that would scan a list of servers check check for a public facing administrator.  

I thought this would be a great example to compare and contrast writing the same simple command line tool in CFML using a CommandBox task runner.  Here is what I came up with

Create your own Desktop "Toaster" Popups in CommandBox Servers

Posted by Brad Wood
Jan 21, 2021 00:16:00 UTC

Here's a quick one that I tried out for the first time today.  Someone asked if it was possible for a CF app to have a desktop notification on the server it's running.  CommandBox servers have a try icon that runs inside the JVM of the server that can create popups and even Swing windows.  Turns out, it's actually really easy to tap into this to get a toaster popup on your desktop.  

Improving Lucee's Query of Query Support

Posted by Brad Wood
Sep 12, 2020 01:29:00 UTC

One of the really great features of CFML is the ability to run SQL against a result set in memory.  This allows you to union separate results together or even apply additional filtering on an exiting result if you can't control what the DB gives you.  Like everything, there is a time and a place for this.  There are people who strongly dislike QoQ (query of queries) but my take is that I think they're great when used with relatively small data sets and unless performance profiling shows they are causing issues, I have no problems using them.  

Who's had more vulns, take 3: Java, ColdFusion, ROR, .NET

Posted by Brad Wood
Oct 09, 2019 01:36:00 UTC

There's a fair amount of disingenuity, or perhaps just willful ignorance to the statistics here and I talk to a lot of people who are astonished that CFML is still in use due to the alleged massive numbers of vulnerabilities.  One would think simply touching the code might give you rabies.  Some CFers suggested that it's a form of "virtue signalling" by infosec professionals to throw CF under the bus, winking at each other over there shared distaste for a platform they have little knowledge of but assume sucks.

A Quick Example Of Functional Programming (FP) In CFML

Posted by Brad Wood
Jun 30, 2019 01:23:00 UTC

I was adding a feature to CommandBox CLI this week when I typed up some code that iterated over the keys in a struct, filtering out the ones it needed and then performed an action on the matching ones.  I used the functional methods structFilter() and structEach() in CFML.  They are an example of functional programming as they accept functions as input.  This also means we can call them "higher order" functions.  But termininologo aside, I typed up the same code using an older interactive approach just to compare the too.  It was an interesting and rather self contained example so I thought I'd share it as a real life use case for FP (functional programming).

Connect To SQLite DB using CFML via CommandBox Task Runners

Posted by Brad Wood
Sep 27, 2018 05:10:00 UTC

Here's a quick trick on working with a SQLite DB from CFML quicky and easily.  I was playing with the SQLite DB that the original .NET version of GitHub for Desktop and I wanted to access the db file from the CLI to query data and manipulate it.  The steps where very easy  

The very first step was the easiest, and this was to create a blank CommandBox Task Runner:

task create --open

Site Updates

Entries Search