diff --git a/gradle.properties b/gradle.properties index a1409ea..6e21a8c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/ortus/boxlang/modules/compat/bifs/system/GetMetaData.java b/src/main/java/ortus/boxlang/modules/compat/bifs/system/GetMetaData.java index db64bb4..b72cb1d 100644 --- a/src/main/java/ortus/boxlang/modules/compat/bifs/system/GetMetaData.java +++ b/src/main/java/ortus/boxlang/modules/compat/bifs/system/GetMetaData.java @@ -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; @@ -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 { @@ -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 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(); }