@@ -791,26 +791,26 @@ impl TargetFactoryBase for TargetFactory {
791791////////////////////////////////////////////////////////////
792792
793793#[ derive( Debug , Clone , Serialize , Deserialize ) ]
794- pub struct SqlStatementAttachmentSpec {
794+ pub struct SqlCommandSpec {
795795 name : String ,
796796 setup_sql : String ,
797797 teardown_sql : Option < String > ,
798798}
799799
800800#[ derive( Debug , Clone , Serialize , Deserialize ) ]
801- pub struct SqlStatementAttachmentState {
801+ pub struct SqlCommandState {
802802 setup_sql : String ,
803803 teardown_sql : Option < String > ,
804804}
805805
806- pub struct SqlStatementAttachmentSetupChange {
806+ pub struct SqlCommandSetupChange {
807807 db_pool : PgPool ,
808808 setup_sql_to_run : Option < String > ,
809809 teardown_sql_to_run : IndexSet < String > ,
810810}
811811
812812#[ async_trait]
813- impl AttachmentSetupChange for SqlStatementAttachmentSetupChange {
813+ impl AttachmentSetupChange for SqlCommandSetupChange {
814814 fn describe_changes ( & self ) -> Vec < String > {
815815 let mut result = vec ! [ ] ;
816816 for teardown_sql in self . teardown_sql_to_run . iter ( ) {
@@ -833,30 +833,30 @@ impl AttachmentSetupChange for SqlStatementAttachmentSetupChange {
833833 }
834834}
835835
836- struct SqlAttachmentFactory ;
836+ struct SqlCommandFactory ;
837837
838838#[ async_trait]
839- impl TargetSpecificAttachmentFactoryBase for SqlAttachmentFactory {
839+ impl TargetSpecificAttachmentFactoryBase for SqlCommandFactory {
840840 type TargetKey = TableId ;
841841 type TargetSpec = Spec ;
842- type Spec = SqlStatementAttachmentSpec ;
842+ type Spec = SqlCommandSpec ;
843843 type SetupKey = String ;
844- type SetupState = SqlStatementAttachmentState ;
845- type SetupChange = SqlStatementAttachmentSetupChange ;
844+ type SetupState = SqlCommandState ;
845+ type SetupChange = SqlCommandSetupChange ;
846846
847847 fn name ( & self ) -> & str {
848- "PostgresSqlAttachment "
848+ "PostgresSqlCommand "
849849 }
850850
851851 fn get_state (
852852 & self ,
853853 _target_name : & str ,
854854 _target_spec : & Spec ,
855- attachment_spec : SqlStatementAttachmentSpec ,
855+ attachment_spec : SqlCommandSpec ,
856856 ) -> Result < TypedTargetAttachmentState < Self > > {
857857 Ok ( TypedTargetAttachmentState {
858858 setup_key : attachment_spec. name ,
859- setup_state : SqlStatementAttachmentState {
859+ setup_state : SqlCommandState {
860860 setup_sql : attachment_spec. setup_sql ,
861861 teardown_sql : attachment_spec. teardown_sql ,
862862 } ,
@@ -867,10 +867,10 @@ impl TargetSpecificAttachmentFactoryBase for SqlAttachmentFactory {
867867 & self ,
868868 target_key : & TableId ,
869869 _attachment_key : & String ,
870- new_state : Option < SqlStatementAttachmentState > ,
871- existing_states : setup:: CombinedState < SqlStatementAttachmentState > ,
870+ new_state : Option < SqlCommandState > ,
871+ existing_states : setup:: CombinedState < SqlCommandState > ,
872872 context : & interface:: FlowInstanceContext ,
873- ) -> Result < Option < SqlStatementAttachmentSetupChange > > {
873+ ) -> Result < Option < SqlCommandSetupChange > > {
874874 let teardown_sql_to_run: IndexSet < String > = if new_state. is_none ( ) {
875875 existing_states
876876 . possible_versions ( )
@@ -888,7 +888,7 @@ impl TargetSpecificAttachmentFactoryBase for SqlAttachmentFactory {
888888 } ;
889889 let change = if setup_sql_to_run. is_some ( ) || !teardown_sql_to_run. is_empty ( ) {
890890 let db_pool = get_db_pool ( target_key. database . as_ref ( ) , & context. auth_registry ) . await ?;
891- Some ( SqlStatementAttachmentSetupChange {
891+ Some ( SqlCommandSetupChange {
892892 db_pool,
893893 setup_sql_to_run,
894894 teardown_sql_to_run,
@@ -902,6 +902,6 @@ impl TargetSpecificAttachmentFactoryBase for SqlAttachmentFactory {
902902
903903pub fn register ( registry : & mut ExecutorFactoryRegistry ) -> Result < ( ) > {
904904 TargetFactory . register ( registry) ?;
905- SqlAttachmentFactory . register ( registry) ?;
905+ SqlCommandFactory . register ( registry) ?;
906906 Ok ( ( ) )
907907}
0 commit comments