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

Stored procedure handling #60

Merged
merged 6 commits into from
May 27, 2014

Conversation

SeriousM
Copy link
Contributor

Here I added the handling of stored procedure calls.
I put a lot of detail on the copy/paste-ability of the existing handling as well on the new one.

I also changed the VerboseSqlServerFormatter to only add information on top of the existing output instead building the same output.

This PR is connected with #48

Added the parameter's direction and the null ability.
…g information on-top instead formatting the sql-command itself.
The SqlServerFormatter now handles the stored procedures in a special way like respecting the parameter directions (output, return).
All sql statements threaten by the SqlServerFormatter are now terminated via a semicolon.
This covers standard sql queries as well as the new stored procedure handling.
@yellis
Copy link
Member

yellis commented May 12, 2014

@SeriousM - Can you please post examples of what the before/after output looks like for stored procedures?

Also, there were a few commits made in since you branched that need to be integrated (specifically 02a7de9 - command defaults to null and need to check for null in your code).

@SeriousM
Copy link
Contributor Author

Thank you for pointing the new commit out, I'm gonna fix it right now.

Regarding the examples:
If a stored procedure is called (and not treated as it is now) the only content of the commandText is the stored procedure itself like dbo.SomeProcedure.
The complete output without my modification would look like this (assume we do have parameters):

DELCARE @x int = 123,
        @y int = 456;

dbo.SomeProcedure;

With my modification however everything is well handled:

DELCARE @x int = 123,
        @y int = 456;

EXEC dbo.SomeProcedure @x = @x, @y = @y;

I even care about output params as well as return params:

DELCARE @x int = 123,
        @y int = 456,
        @outGoesHere int = null,
        @retVal int;

EXEC @retVal = dbo.SomeProcedure @x = @x, @y = @y, @outGoesHere = @outGoesHere OUTPUT;
SELECT @retVal as ReturnValue;

I could write the stored procedure call like this EXEC dbo.SomeProcedure @x, @y; but then I would trigger a parameter-ordering problem; thats why I reassign them.

@SeriousM
Copy link
Contributor Author

any updates @yellis? would be cool if it would be included in the next release.

@yellis
Copy link
Member

yellis commented May 13, 2014

Hope to get to it soon, but as it has regression potential need to test a
bit first.

On Tue, May 13, 2014 at 5:57 PM, Bernhard Millauer <notifications@github.com

wrote:

any updates @yellis https://github.com/yellis?


Reply to this email directly or view it on GitHubhttps://github.com//pull/60#issuecomment-42965847
.

@SeriousM
Copy link
Contributor Author

Hi @yellis, sorry to bother you.
any updates on the PR?

@SeriousM
Copy link
Contributor Author

Hi guys, any updates on the PR?
I put some hours into this so it would be nice if we could finish it.
Thanks

yellis added a commit that referenced this pull request May 27, 2014
@yellis yellis merged commit e5b7b49 into MiniProfiler:master May 27, 2014
@SeriousM SeriousM deleted the stored_procedure_handling branch May 27, 2014 10:56
@SeriousM
Copy link
Contributor Author

Wonderful, thank you. Is there an ETA for the release?

@yellis
Copy link
Member

yellis commented May 27, 2014

ETA on release 3.0.11 is about 2 hours ago. Please let me know if there are any issues.

@SeriousM
Copy link
Contributor Author

looks good! I might change a small bit but this will be done in another PR. the functionality is there and works as expected. thanks @yellis

@yellis
Copy link
Member

yellis commented May 27, 2014

good to hear

yellis added a commit that referenced this pull request Jun 8, 2014
…ed procedure formatting enhancements from #60. Nuget to v3.1.
@yellis
Copy link
Member

yellis commented Jun 11, 2014

Please use release v3.1+ if you want to take advantage of the features included here (they were included in v3.0.11 but removed from v3.0.12, for reasons discussed in #68).

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

Successfully merging this pull request may close these issues.

2 participants