Skip to content

Commit

Permalink
Merge pull request #9 from ortus-boxlang/development
Browse files Browse the repository at this point in the history
vlatest
  • Loading branch information
lmajano authored Sep 30, 2024
2 parents f7c3e6b + 0b64ac0 commit 6a74a73
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Thu Sep 19 13:43:38 UTC 2024
#Thu Sep 19 15:03:48 UTC 2024
boxlangVersion=1.0.0-snapshot
jdkVersion=21
version=1.6.0
version=1.7.0
group=ortus.boxlang
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package ortus.boxlang.modules.compat.bifs.system;

import java.util.Map;

import ortus.boxlang.runtime.bifs.BIF;
import ortus.boxlang.runtime.bifs.BoxBIF;
import ortus.boxlang.runtime.context.IBoxContext;
Expand All @@ -22,6 +24,10 @@
import ortus.boxlang.runtime.scopes.Key;
import ortus.boxlang.runtime.types.Argument;
import ortus.boxlang.runtime.types.Function;
import ortus.boxlang.runtime.types.Query;
import ortus.boxlang.runtime.types.QueryColumn;
import ortus.boxlang.runtime.types.Array;
import ortus.boxlang.runtime.types.Struct;

@BoxBIF
public class GetMetaData extends BIF {
Expand Down Expand Up @@ -58,6 +64,18 @@ public Object _invoke( IBoxContext context, ArgumentsScope arguments ) {
return boxClass.getMetaData();
}

if ( value instanceof Query query ) {
Array columnMetadata = new Array();
for ( Map.Entry<Key, QueryColumn> entry : query.getColumns().entrySet() ) {
columnMetadata.add( Struct.of(
Key._name, entry.getKey(),
Key.typename, entry.getValue().getType().toString(),
Key.of( "isCaseSensitive" ), false
) );
}
return columnMetadata;
}

// All other types return the class of the value to match CF engines
return value.getClass();
}
Expand Down

0 comments on commit 6a74a73

Please sign in to comment.