forest_admin_datasource_rpc 1.25.1 → 1.25.2

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: 6473d3b105d21ba059701998a1179cb820551ffd9efc471a6850d23add3bbdad
4
- data.tar.gz: bf4c243fe556572d5b634f9cef370ee3b09d6800ae3d8cf5a1d45806e3ed9481
3
+ metadata.gz: 422ac8ba74ee59856552a1f656b97504649adc5b9c7d5413b8a3ef8c48cce2b3
4
+ data.tar.gz: fcfd326aae52472ffb1b26761538e1e949487c87cf4e5f0bb15c4720618cc759
5
5
  SHA512:
6
- metadata.gz: a443bb560f80a2f96d2b70c32ddb32abf53fd3fe9881dacb49caa021c0c8894a15c25d21f9c2eb83683c3d82557d503538461b75c112c368c404becb745eccd3
7
- data.tar.gz: 55da1ddd18d8eea56472cba795e1622e88d3ede2ead212b0e4b3c3e4cf15ed3ea27635d89ae0058efdf20f8c0e245e22cb23013e902a27571bcdc67a4051b200
6
+ metadata.gz: a945b6fab5fcb635b8a4b5b225772452a497d354ddf51e93b00fa65795b27c0b5fde4e66ca6d6b26aff5fa31c899e5cbb26cbe70e48eaed52ffdea83f0447344
7
+ data.tar.gz: b45a7255c3d14d28d5426d8a7869755d8f174b5c95225c205fa275346f5532d40cfb7132f43bd2442cf69606a6e4bd4d5929657a517c732bfec666ee084f599d
@@ -63,6 +63,22 @@ module ForestAdminDatasourceRpc
63
63
  ForestAdminDatasourceToolkit::Utils::HashHelper.convert_keys(result.to_a)
64
64
  end
65
65
 
66
+ def refresh!(new_schema)
67
+ # Replace collections with those from the new schema
68
+ @collections = {}
69
+ new_schema[:collections].each do |collection|
70
+ add_collection(Collection.new(self, collection[:name], collection))
71
+ end
72
+
73
+ @charts = new_schema[:charts]
74
+ @rpc_relations = new_schema[:rpc_relations]
75
+
76
+ native_query_connections = new_schema[:native_query_connections] || []
77
+ @live_query_connections = native_query_connections.to_h { |conn| [conn[:name], conn[:name]] }
78
+
79
+ @schema = { charts: @charts }
80
+ end
81
+
66
82
  def cleanup
67
83
  return if @cleaned_up
68
84
 
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceRpc
2
- VERSION = "1.25.1"
2
+ VERSION = "1.25.2"
3
3
  end
@@ -35,16 +35,19 @@ module ForestAdminDatasourceRpc
35
35
  # Auto-configure pool with default settings if not already configured
36
36
  ensure_pool_configured
37
37
 
38
+ datasource_ref = nil
39
+
38
40
  schema_polling = Utils::SchemaPollingClient.new(
39
41
  uri,
40
42
  auth_secret,
41
43
  polling_interval: polling_interval,
42
44
  introspection: provided_introspection
43
- ) do
45
+ ) do |new_schema|
44
46
  Thread.new do
45
47
  logger = ForestAdminAgent::Facades::Container.logger
46
48
  logger.log('Info', '[RPCDatasource] Schema change detected, reloading agent in background...')
47
49
  begin
50
+ datasource_ref&.refresh!(new_schema)
48
51
  ForestAdminAgent::Builder::AgentFactory.instance.reload!
49
52
  logger.log('Info', '[RPCDatasource] Agent reload completed successfully')
50
53
  rescue StandardError => e
@@ -65,7 +68,7 @@ module ForestAdminDatasourceRpc
65
68
  end
66
69
 
67
70
  options.delete(:introspection)
68
- ForestAdminDatasourceRpc::Datasource.new(options, schema, schema_polling)
71
+ datasource_ref = ForestAdminDatasourceRpc::Datasource.new(options, schema, schema_polling)
69
72
  end
70
73
 
71
74
  def self.ensure_pool_configured
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_datasource_rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.25.1
4
+ version: 1.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2026-03-04 00:00:00.000000000 Z
12
+ date: 2026-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: base64