forest_admin_datasource_rpc 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9532f5e6a271644c89f0bbede323640392302acba76b9f1310ae9795f98ea92
|
4
|
+
data.tar.gz: bf4b8f04bab3c5560c8ea29d6f5c0bd5297d2c4738f635ee4a9fbd4bc3eb5241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87bc0f3aad98bfc9d3da8ee192b048cb6680a67d4e59d8ce8b07f22d54b307b13b1193524f730715f6094238d11d53f1ae63635bbd7795db43dd81e839113c7a
|
7
|
+
data.tar.gz: b1dc1356f6a0c2dcb0fb8227b123f0e71047399a7e06f77f7364089643f968f608f0f3ee0966af03307cc068b426ab9c2324931a97ca4a6ec74ab76baf6f9239
|
@@ -19,6 +19,9 @@ module ForestAdminDatasourceRpc
|
|
19
19
|
@charts = introspection[:charts]
|
20
20
|
@rpc_relations = introspection[:rpc_relations]
|
21
21
|
|
22
|
+
native_query_connections = introspection[:nativeQueryConnections] || []
|
23
|
+
@live_query_connections = native_query_connections.to_h { |conn| [conn[:name], conn[:name]] }
|
24
|
+
|
22
25
|
@schema = { charts: @charts }
|
23
26
|
end
|
24
27
|
|
@@ -33,5 +36,17 @@ module ForestAdminDatasourceRpc
|
|
33
36
|
|
34
37
|
client.call_rpc(url, method: :post, payload: { chart: name, caller: caller.to_h })
|
35
38
|
end
|
39
|
+
|
40
|
+
def execute_native_query(connection_name, query, binds)
|
41
|
+
client = RpcClient.new(@options[:uri], ForestAdminRpcAgent::Facades::Container.cache(:auth_secret))
|
42
|
+
url = 'forest/rpc/native-query'
|
43
|
+
|
44
|
+
ForestAdminRpcAgent::Facades::Container.logger.log(
|
45
|
+
'Debug',
|
46
|
+
"Forwarding native query for connection '#{connection_name}' to the Rpc agent on #{url}."
|
47
|
+
)
|
48
|
+
|
49
|
+
client.call_rpc(url, method: :post, payload: { connection_name: connection_name, query: query, binds: binds })
|
50
|
+
end
|
36
51
|
end
|
37
52
|
end
|