Skip to content

Commit 860d62c

Browse files
committed
ExecuteQuery in interoperability
1 parent 8028a62 commit 860d62c

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

isc/py/ens/Operation.cls

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ XData MessageMap
2121
<MapItem MessageType="isc.py.msg.RestoreRequest">
2222
<Method>RestoreContext</Method>
2323
</MapItem>
24+
<MapItem MessageType="isc.py.msg.QueryRequest">
25+
<Method>ExecuteQuery</Method>
26+
</MapItem>
2427
</MapItems>
2528
}
2629

@@ -77,6 +80,15 @@ Method StreamExecute(request As isc.py.msg.StreamExecutionRequest, Output respon
7780
quit sc
7881
}
7982

83+
/// Create pandas dataframe or list form sql.
84+
Method ExecuteQuery(request As isc.py.msg.QueryRequest, Output response As Ens.Response) As %Status
85+
{
86+
#dim sc As %Status = $$$OK
87+
set response = ##class(Ens.Response).%New()
88+
set sc = ##class(isc.py.Main).ExecuteQuery(request.Query, request.Variable, request.Type)
89+
quit sc
90+
}
91+
8092
/// Save context
8193
Method SaveContext(request As isc.py.msg.SaveRequest, Output response As Ens.StringResponse) As %Status
8294
{

isc/py/msg/QueryRequest.cls

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/// Create pandas dataframe or list form sql.
2+
Class isc.py.msg.QueryRequest Extends Ens.Request
3+
{
4+
5+
Property Query As %VarString;
6+
7+
Property Variable As %String;
8+
9+
Property Type As %String(VALUELIST = ",dataframe,list") [ InitialExpression = "list" ];
10+
11+
Storage Default
12+
{
13+
<Data name="QueryRequestDefaultData">
14+
<Subscript>"QueryRequest"</Subscript>
15+
<Value name="1">
16+
<Value>Query</Value>
17+
</Value>
18+
<Value name="2">
19+
<Value>Variable</Value>
20+
</Value>
21+
</Data>
22+
<DefaultData>QueryRequestDefaultData</DefaultData>
23+
<Type>%Library.CacheStorage</Type>
24+
}
25+
26+
}
27+

0 commit comments

Comments
 (0)