diff --git a/src/main/bx/ModuleConfig.bx b/src/main/bx/ModuleConfig.bx index 3f4ea2d..e3e3560 100644 --- a/src/main/bx/ModuleConfig.bx +++ b/src/main/bx/ModuleConfig.bx @@ -140,11 +140,11 @@ // Register SQLType compatibility interceptor interceptorService.newAndRegister( // Class path - "#moduleRecord.invocationPath#.interceptors.CFSqlType", + "#moduleRecord.invocationPath#.interceptors.QueryCompat", // Properties Struct settings, // Unique Name - "CFSqlType@compat", + "QueryCompat@compat", // Module Record moduleRecord ); diff --git a/src/main/bx/interceptors/CFSqlType.bx b/src/main/bx/interceptors/QueryCompat.bx similarity index 66% rename from src/main/bx/interceptors/CFSqlType.bx rename to src/main/bx/interceptors/QueryCompat.bx index 2eab8f1..fe44074 100644 --- a/src/main/bx/interceptors/CFSqlType.bx +++ b/src/main/bx/interceptors/QueryCompat.bx @@ -20,7 +20,12 @@ import java:ortus.boxlang.runtime.types.immutable.ImmutableStruct; import java:ortus.boxlang.runtime.scopes.Key; /** - * Renames `cfsqltype` to `sqltype` in the query parameters for improved CFML compatibility. + * Improves queryExecute() and Query component compatibility with CFML syntax and options. + * + * */ class{ @@ -35,14 +40,21 @@ class{ * - sql : The SQL string * - parameters : The parameters to be used in the query * - pendingQuery : The BoxLang query class used to build and execute queries + * - options : A struct of query options, if any, set at query time via `queryExecute()` or `` */ function onQueryBuild( struct data ){ - // Add coldfusion struct data.parameters.map( ( param ) -> { - if( param.keyExists( "cfsqltype" ) ){ + if( param.keyExists( "cfsqltype" ) && !param.keyExists( "sqltype" ) ){ param.sqltype = param.cfsqltype; } }); + + // add blockfactor -> fetchsize alias + data.options.map( ( param ) -> { + if( param.keyExists( "blockfactor" ) && !param.keyExists( "fetchSize" ) ){ + param.fetchSize = param.blockfactor; + } + }); } }