Into The Box 2020�QB For the Rest Of Us: 1.21 Gigawatts of Fluent and Functional
Samuel W. Knowlton
sam@inleague.io / @MordantWastrel / @SKnowlton (CFML Slack)
inLeague LLC
Austin, TX
Professional Dilettante Generalist
What is QB?
Queries: Why We CFML!�What should we be using in 2020?
Queries: Why We CFML!�What should we be using in 2020?
5 Reasons To Use
3. It’s the basis for Quick ORM
4. Modern patterns for managing complex SQL: No more concatenating query text
5. Builder Syntax means Functional Programming and coolguy method chaining:
.from(), .select(), and .selectRaw()
Ordinary QB and Escape Hatches
queryExecute( “SELECT wo.description FROM `workorder`”);
WHERE Bootstrapping in QB:�NOPE
Conditionals
Detour: Where A and (B OR C)
Can I Still Use queryExecute()?
Joins and WhereIn
QB Query Params
Order By
Or an array of strings, an array of structs, a subQuery, or a raw expression!
The Final workorder query, inLeague edition
toSQL(): Debugging QB
Re-Using Builder Objects
…get()? Executing the Query & Return Types
QB Interceptors: High-Powered QB Debugging in Coldbox
cbDebugger 2.0 and QB
When Ortus Makes a Better Version of Your Demo
SchemaBuilder and Migrations
Update, Insert, Delete
Sir Not Appearing In This Film:�Other Great QB Features
.groupBy( string / array ) | .having( column, operator, value, combinator) |
.limit( value ) | .offset( offset ) |
.forPage( page, maxRows ) | .paginate() |
.union( closure / QueryBuilder ) | .unionAll( closure / QueryBuilder ) |
.with( name, input, columns, recursive) | .withRecursive( name, input, columns ) |
.whereBetween( column, start, end ) | .whereColumn( first, operator, second ) |
.whereExists( query ) | .whereLike( column, value ) |
.whereNull( column ) | .count(), .max(), .min(), .sum(), .exists() |
What’s New in QB 7
QB Resources