@@ -100,13 +100,15 @@ func (pge *PgEngine) ExecStandaloneTask(ctx context.Context, connf func() (PgxCo
100
100
101
101
// ExecRemoteSQLTask executes task against remote connection
102
102
func (pge * PgEngine ) ExecRemoteSQLTask (ctx context.Context , task * ChainTask , paramValues []string ) (string , error ) {
103
+ log .GetLogger (ctx ).Info ("Switching to remote task mode" )
103
104
return pge .ExecStandaloneTask (ctx ,
104
105
func () (PgxConnIface , error ) { return pge .GetRemoteDBConnection (ctx , task .ConnectString .String ) },
105
106
task , paramValues )
106
107
}
107
108
108
109
// ExecAutonomousSQLTask executes autonomous task in an acquired connection from pool
109
110
func (pge * PgEngine ) ExecAutonomousSQLTask (ctx context.Context , task * ChainTask , paramValues []string ) (string , error ) {
111
+ log .GetLogger (ctx ).Info ("Switching to autonomous task mode" )
110
112
return pge .ExecStandaloneTask (ctx ,
111
113
func () (PgxConnIface , error ) { return pge .GetLocalDBConnection (ctx ) },
112
114
task , paramValues )
@@ -158,7 +160,7 @@ func (pge *PgEngine) GetRemoteDBConnection(ctx context.Context, connectionString
158
160
// FinalizeDBConnection closes session
159
161
func (pge * PgEngine ) FinalizeDBConnection (ctx context.Context , remoteDb PgxConnIface ) {
160
162
l := log .GetLogger (ctx )
161
- l .Info ("Closing remote session" )
163
+ l .Info ("Closing standalone session" )
162
164
if err := remoteDb .Close (ctx ); err != nil {
163
165
l .WithError (err ).Error ("Cannot close database connection:" , err )
164
166
}
@@ -170,15 +172,15 @@ func (pge *PgEngine) SetRole(ctx context.Context, executor executor, runUID pgty
170
172
if ! runUID .Valid || strings .TrimSpace (runUID .String ) == "" {
171
173
return nil
172
174
}
173
- log .GetLogger (ctx ).Info ("Setting Role to " , runUID .String )
175
+ log .GetLogger (ctx ).Info ("Setting role to " , runUID .String )
174
176
_ , err := executor .Exec (ctx , fmt .Sprintf ("SET ROLE %v" , runUID .String ))
175
177
return err
176
178
}
177
179
178
180
// ResetRole - RESET forms reset the current user identifier to be the current session user identifier
179
181
func (pge * PgEngine ) ResetRole (ctx context.Context , executor executor ) {
180
182
l := log .GetLogger (ctx )
181
- l .Info ("Resetting Role " )
183
+ l .Info ("Resetting role " )
182
184
_ , err := executor .Exec (ctx , `RESET ROLE` )
183
185
if err != nil {
184
186
l .WithError (err ).Error ("Failed to set a role" , err )
0 commit comments