@@ -147,6 +147,7 @@ def download_and_run(
147
147
alter_system : bool = True ,
148
148
allow_override : bool = False ,
149
149
wait_for_completion : bool = True ,
150
+ print_activation_statements : bool = True ,
150
151
) -> None :
151
152
"""
152
153
Downloads the language container from the provided url to a temporary file and then deploys it.
@@ -158,6 +159,8 @@ def download_and_run(
158
159
allow_override - If True the activation of a language container with the same alias will be
159
160
overriden, otherwise a RuntimeException will be thrown.
160
161
wait_for_completion - If True will wait until the language container becomes operational.
162
+ print_activation_statements - If True and alter_system is False,
163
+ it will print the ALTER SESSION command to stdout.
161
164
"""
162
165
163
166
with tempfile .NamedTemporaryFile () as tmp_file :
@@ -171,6 +174,7 @@ def download_and_run(
171
174
alter_system ,
172
175
allow_override ,
173
176
wait_for_completion ,
177
+ print_activation_statements ,
174
178
)
175
179
176
180
def _upload_path (self , bucket_file_path : str | None ) -> bfs .path .PathLike :
@@ -183,6 +187,7 @@ def run(
183
187
alter_system : bool = True ,
184
188
allow_override : bool = False ,
185
189
wait_for_completion : bool = True ,
190
+ print_activation_statements : bool = True ,
186
191
) -> None :
187
192
"""
188
193
Deploys the language container. This includes two steps, both of which are optional:
@@ -203,6 +208,8 @@ def run(
203
208
For this to work either of the two conditions should be met.
204
209
The pyexasol connection should have an open schema, or
205
210
The calling user should have a permission to create schema.
211
+ print_activation_statements - If True and alter_system is False,
212
+ it will print the ALTER SESSION command to stdout.
206
213
"""
207
214
208
215
if not bucket_file_path :
@@ -225,18 +232,18 @@ def run(
225
232
if container_file and wait_for_completion :
226
233
self ._wait_container_upload_completion (bucket_file_path )
227
234
228
- if not alter_system :
235
+ if not alter_system and print_activation_statements :
229
236
message = dedent (
230
237
f"""
231
- In SQL, you can activate the SLC
232
- by using the following statements:
233
-
234
- To activate the SLC only for the current session:
235
- { self .generate_activation_command (bucket_file_path , LanguageActivationLevel .Session , True )}
236
-
237
- To activate the SLC on the system:
238
- { self .generate_activation_command (bucket_file_path , LanguageActivationLevel .System , True )}
239
- """
238
+ In SQL, you can activate the SLC
239
+ by using the following statements:
240
+
241
+ To activate the SLC only for the current session:
242
+ { self .generate_activation_command (bucket_file_path , LanguageActivationLevel .Session , True )}
243
+
244
+ To activate the SLC on the system:
245
+ { self .generate_activation_command (bucket_file_path , LanguageActivationLevel .System , True )}
246
+ """
240
247
)
241
248
print (message )
242
249
0 commit comments