Debian Codegraph @

ansible_collections/lowlydba/sqlserver/plugins/modules/nonquery.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # (c) 2022, John McCall (@lowlydba)
5 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r'''
8 ---
9 module: nonquery
10 short_description: Executes a generic nonquery
11 description:
12 - Execute a nonquery against a database. Does not return a resultset. Ideal for ad-hoc configurations or DML queries.
13 version_added: 0.1.0
14 options:
15 database:
16 description:
17 - Name of the database to execute the nonquery in.
18 type: str
19 required: true
20 nonquery:
21 description:
22 - The nonquery to be executed.
23 type: str
24 required: true
25 query_timeout:
26 description:
27 - Number of seconds to wait before timing out the nonquery execution.
28 type: int
29 required: false
30 default: 60
31 author: "John McCall (@lowlydba)"
32 requirements:
33 - L(dbatools,https://www.powershellgallery.com/packages/dbatools/) PowerShell module
34 extends_documentation_fragment:
35 - lowlydba.sqlserver.sql_credentials
36 - lowlydba.sqlserver.attributes.check_mode
37 - lowlydba.sqlserver.attributes.platform_all
38 '''
39
40 EXAMPLES = r'''
41 - name: Update a table value
42 lowlydba.sqlserver.nonquery:
43 sql_instance: sql-01-myco.io
44 database: userdb
45 nonquery: "UPDATE dbo.User set IsActive = 1;"
46 '''
47
48 RETURN = r''' # '''