(loop_def, variables, cursor: Cursor, connection: Connection)
| 121 | |
| 122 | |
| 123 | def execute_loop(loop_def, variables, cursor: Cursor, connection: Connection): |
| 124 | loop_var_name = loop_def['as'] |
| 125 | loop_variables = variables.copy() |
| 126 | |
| 127 | if 'over' in loop_def: |
| 128 | iterable = loop_def['over'] |
| 129 | elif 'range' in loop_def: |
| 130 | start = loop_def['range']['start'] |
| 131 | end = loop_def['range']['end'] |
| 132 | iterable = range(start, end + 1) |
| 133 | else: |
| 134 | raise ValueError("Loop must have 'over' or 'range' defined.") |
| 135 | |
| 136 | for item in iterable: |
| 137 | loop_variables[loop_var_name] = item |
| 138 | execute_steps(loop_def['steps'], loop_variables, cursor, connection) |
| 139 | |
| 140 | |
| 141 | def wrap_varchar_arrays(parameters, param_types): |
no test coverage detected
searching dependent graphs…