Skip to content

Commit

Permalink
chore(qb): Upgrade to qb v10
Browse files Browse the repository at this point in the history
Update to the latest qb version.

BREAKING CHANGE: Upgrade to qb v10
  • Loading branch information
elpete committed Oct 8, 2024
1 parent 623d056 commit 8a9be8f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"type":"modules",
"dependencies":{
"qb":"^9.8.0",
"qb":"^10.0.1",
"str":"^4.0.0",
"mementifier":"^3.0.0"
},
Expand Down
25 changes: 1 addition & 24 deletions models/QuickBuilder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ component accessors="true" transientCache="false" {
variables.qb.getColumns()[ 1 ] == "*"
)
) {
variables.qb.select( variables.qb.getFrom() & ".*" );
variables.qb.select( variables.qb.getTableName() & ".*" );
}

var subselectQuery = arguments.subselect;
Expand Down Expand Up @@ -688,29 +688,6 @@ component accessors="true" transientCache="false" {
return getEntity().mappingName();
}

/**
* Creates a new query using the same Grammar and QueryUtils.
*
* @return quick.models.QuickBuilder
*/
// public QuickBuilder function newQuery() {
// var builder = new quick.models.QuickBuilder(
// grammar = getGrammar(),
// utils = getUtils(),
// returnFormat = getReturnFormat(),
// paginationCollector = isNull( variables.paginationCollector ) ? javacast( "null", "" ) : variables.paginationCollector,
// defaultOptions = getDefaultOptions(),
// preventDuplicateJoins = getPreventDuplicateJoins()
// );
// builder.setEntity( getEntity() );
// builder.setFrom( getEntity().tableName() );
// builder.setColumnFormatter( function( column ) {
// return builder.qualifyColumn( column );
// } );
// applyInheritanceJoins( builder );
// return builder;
// }

function applyInheritanceJoins() {
var entity = getEntity();
// Apply and append any inheritance joins/columns
Expand Down
2 changes: 1 addition & 1 deletion models/QuickQB.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ component
);
newBuilder.setQuickBuilder( getQuickBuilder() );
newBuilder.setEntity( getEntity() );
newBuilder.setFrom( getFrom() );
newBuilder.setTableName( getTableName() );
return newBuilder;
}

Expand Down
6 changes: 3 additions & 3 deletions models/Relationships/HasManyDeep.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ component
public void function performJoin( any builder = variables.relationshipBuilder ) {
var segments = arguments.builder
.getQB()
.getFrom()
.getTableName()
.split( "[Aa][Ss]" );
var alias = segments[ 2 ] ?: "";

Expand Down Expand Up @@ -212,7 +212,7 @@ component
public array function getQualifiedForeignKeyNames( any builder = variables.relationshipBuilder ) {
var segments = arguments.builder
.getQB()
.getFrom()
.getTableName()
.split( "[Aa][Ss]" );
var alias = segments[ 2 ] ?: "";

Expand All @@ -238,7 +238,7 @@ component
public array function getQualifiedLocalKeys( any builder = variables.relationshipBuilder ) {
var segments = arguments.builder
.getQB()
.getFrom()
.getTableName()
.split( "[Aa][Ss]" );
var alias = segments[ 2 ] ?: "";

Expand Down

0 comments on commit 8a9be8f

Please sign in to comment.