@@ -25,8 +25,7 @@ use flow::FrontendClient;
2525#[ cfg( feature = "enterprise" ) ]
2626use operator:: statement:: TriggerQuerierRef ;
2727
28- use crate :: extension:: common:: { InformationSchemaTableFactories , TableFactoryContext } ;
29-
28+ /// The extension point for standalone instance.
3029#[ derive( Default ) ]
3130pub struct Extension {
3231 #[ cfg( feature = "enterprise" ) ]
@@ -35,7 +34,7 @@ pub struct Extension {
3534 pub trigger_querier : Option < TriggerQuerierRef > ,
3635}
3736
38- /// Factory trait to create Extension instances .
37+ /// Factory trait to create Extension instance .
3938pub trait ExtensionFactory : InformationSchemaTableFactories + Send + Sync {
4039 fn create (
4140 & self ,
@@ -49,6 +48,28 @@ pub struct ExtensionContext {
4948 pub frontend_client : Arc < FrontendClient > ,
5049}
5150
51+ /// Provides additional information schema table factories beyond the built-in
52+ /// ones.
53+ ///
54+ /// These are typically provided by enterprise or optional modules, such as:
55+ /// - `information_schema.triggers`
56+ /// - `information_schema.alerts`
57+ #[ async_trait:: async_trait]
58+ pub trait InformationSchemaTableFactories : Send + Sync {
59+ async fn create_factories (
60+ & self ,
61+ ctx : TableFactoryContext ,
62+ ) -> Result < HashMap < String , InformationSchemaTableFactoryRef > , BoxedError > ;
63+ }
64+
65+ pub type InformationSchemaTableFactoriesRef = Arc < dyn InformationSchemaTableFactories > ;
66+
67+ /// Context for information schema table factory providers.
68+ pub struct TableFactoryContext {
69+ pub fe_client : Arc < FrontendClient > ,
70+ }
71+
72+ /// Default no-op implementation of ExtensionFactory.
5273pub struct DefaultExtensionFactory ;
5374
5475#[ async_trait:: async_trait]
0 commit comments