Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to cast XML results as nvarchar(max) in order to work with sqlcmd on Linux #55

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nsturmwind
Copy link

Addresses #54

@@ -735,7 +739,14 @@ BEGIN
FOR XML EXPLICIT
);

EXEC tSQLt.Private_PrintXML @XmlOutput;
If @CastToNvarchar = 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than adding IF statement there, it would probably better be moved to the Private_PrintXML procedure as now outputting logic is split in 2 different places that kind of bad practice.
Additionally this framework is written using TDD approach so you should write tests to cover this functionality otherwise I'm not sure it will be merged.
And final minor comment is that keywords in this source code are all in UPPERCASE (If, nvarchar, max)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. Is there a CI framework that runs the tests?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently you can only do that locally. If you go to the Build folder, you'll find Install the tSQLt build.docx document with instructions. And if you have troubles with the certificate, you can take a look to the ChangeSigningKey_ReadMe.txt document.
The tests should probably need to be put to the Tests/Run_Methods_Tests.class.sql file

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, you won't be able to do that on Linux ... However as I see from commits, that @mbt1 is currently working on setting automated tests on GitHub so there might be such possibility in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants