|
62 | 62 | description: Use encrypted connection. |
63 | 63 | type: bool |
64 | 64 | default: false |
| 65 | + properties: |
| 66 | + description: |
| 67 | + - Sets SQLDBC connect options e.g. sqlMode=SAPR3 |
| 68 | + - Must be a string or list containing strings. |
| 69 | + - See SAP HANA documentation for list of available options. |
| 70 | + type: list |
| 71 | + elements: str |
65 | 72 | filepath: |
66 | 73 | description: |
67 | 74 | - One or more files each containing one SQL query to run. |
|
142 | 149 | - select user_name from users |
143 | 150 | - select * from users |
144 | 151 | autocommit: False |
| 152 | +
|
| 153 | +- name: Run query with SQLDBC connect options |
| 154 | + community.sap_libs.sap_hdbsql: |
| 155 | + sid: "hdb" |
| 156 | + instance: "01" |
| 157 | + password: "Test123" |
| 158 | + query: select user_name from users |
| 159 | + properties: |
| 160 | + - "sqlMode=SAPR3" |
| 161 | + - "sslHostNameInCertificate=hana.example.com" |
145 | 162 | ''' |
146 | 163 |
|
147 | 164 | RETURN = r''' |
@@ -205,6 +222,7 @@ def main(): |
205 | 222 | query=dict(type='list', elements='str', required=False), |
206 | 223 | filepath=dict(type='list', elements='path', required=False), |
207 | 224 | autocommit=dict(type='bool', default=True), |
| 225 | + properties=dict(type='list', elements='str', required=False), |
208 | 226 | ), |
209 | 227 | required_one_of=[('query', 'filepath')], |
210 | 228 | required_if=[('userstore', False, ['password'])], |
@@ -260,6 +278,10 @@ def main(): |
260 | 278 | if params['database']: |
261 | 279 | command.extend(['-d', params['database']]) |
262 | 280 |
|
| 281 | + if params['properties']: |
| 282 | + for prop in params['properties']: |
| 283 | + command.extend(['-Z', prop]) |
| 284 | + |
263 | 285 | if params['userstore']: |
264 | 286 | command.extend(['-x', '-U', params['user']]) |
265 | 287 |
|
|
0 commit comments