* Added transactional(rollback/commit) support to mssql_script module via optional boolean param 'transaction'
* Added changelog fragment
* Implemented PR Review comments by felixfontein
* feat: Allow non-returning SQL statements
- The current implementation fails out when certain statements or
batches do not have resultsets - this limits the usefulness of the
module
- Instead, it is known that statements without resultsets return then
OperationalError exception with text "Statement not executed or
executed statement has no resultset". We will utilize these facts to
accept these statements
- The implementation also assumes that users will always use best-
practices for the script syntax; that is, "GO" will always be
capitalized but this is not strictly required -- update to allow "GO"
to be any mixed-case
Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>
* feat: Add changelog fragment for change
- Add changelog fragment for PR 6192
Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>
* feat: Improve batching
- Previous batching had shortcomings like making strict assumptions
about the format of the incoming script and did not handle Windows-
based scripts (e.g. \r characters). It also did not handle cases where
there were trailing or leading whitespace characters round the 'GO'
- Added a special case for removing the Byte Order Mark (BOM) character
that may come as part of a script when slurped from some hosts.
Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>
* feat: Use str.splitlines()
- Use of this method is cleaner
Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>
* Update changelogs/fragments/6192-allow-empty-resultsets.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix: Update transcribing errors
- Replace local namespace with project namespace
- Remove 'return' statement from the module.fail_json call
Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>
---------
Signed-off-by: Lesley Kimmel <lesley.j.kimmel@gmail.com>
Co-authored-by: Lesley Kimmel <lesleyk@vmware.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* added module mssql_script
* Add changelog fragment
* fixed fragment file (yamllint)
* added me as maintainer
* minor cleanup. (PR comments)
* adjusted for PR comments
- changed key for query results depending on output
- removed "empty" string defaults
* convert unserializable values to string
* python 2 support
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* updates to docs
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>