Debug improvement suggestion

Posts   
 
    
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 12-Sep-2006 16:43:53   

OK, we can switch on generated sql query debug output and that's fine. However, it would be very nice to have a ready-to-execute sql statement handy.

I mean properly formated so one could copy&paste to sql server manager (or any other sql statement executing capable tool). And I am talking mostly about parameters output, since query formatting is almost there (Query: word should be stripped or moved up one line)

So instead of:

Parameter: @IsPublic1 : Boolean. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: True.

we might have:

DECLARE @IsPublic1 bit
SET @IsPublic1 = 1
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 12-Sep-2006 16:51:21   

Yes, this would be nice. I have a helper application that does this reformatting, but built-in would be nicer.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 12-Sep-2006 17:31:33   

problem is that the query tracing output is performed in generic code, while the parameter output as you describe it, would require db specific text...

Frans Bouma | Lead developer LLBLGen Pro
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 12-Sep-2006 18:16:59   

Otis wrote:

problem is that the query tracing output is performed in generic code, while the parameter output as you describe it, would require db specific text...

Ehm, virtual methods? :-)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 12-Sep-2006 19:11:48   

mihies wrote:

Otis wrote:

problem is that the query tracing output is performed in generic code, while the parameter output as you describe it, would require db specific text...

Ehm, virtual methods? :-)

Heh oh? What are they? wink

stuck_out_tongue_winking_eye Ok, but, I then also have to implement db specific parameter objects or something. Pretty overkill because where to override the virtual methods? simple_smile

Frans Bouma | Lead developer LLBLGen Pro
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 12-Sep-2006 19:38:47   

Can't you just add a (virtual stuck_out_tongue_winking_eye ) method to (i.e.) DynamicQueryEngine that accepts a (db-independent) parameter and outputs the text I mentioned?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 13-Sep-2006 10:31:58   

mihies wrote:

Can't you just add a (virtual stuck_out_tongue_winking_eye ) method to (i.e.) DynamicQueryEngine that accepts a (db-independent) parameter and outputs the text I mentioned?

That would be possible if the code in which the tracing takes place has a reference to the DQE, but that's not the case.

Frans Bouma | Lead developer LLBLGen Pro
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 13-Sep-2006 11:35:59   

OK, to sum it up. The feature is very handy and if you don't implement it I'll do it in a way or another sunglasses So, shall I start coding? (note that I am not pushing anything-ok, a little simple_smile -just need to make a decision)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 13-Sep-2006 12:40:07   

Well, the tracing is done inside the Query class. (in the override of ToString())

The query object doesn't have a reference from a DQE, nor does the caller of the ToString() method (TraceHelper.WriteIf etc.) know the DQE. THe problem is that the call to the tracehelper is done from the DQE, however the tracehelper is generic code. So the DQE has to be passed into the query when the tracehelper method is called. But, that is not what you want, as the DQE has no business inside the query object. So you've to make the TEST to see if you have to call the tracehelper around the call to the tracehelper (testing the flags). Error prone.

Frans Bouma | Lead developer LLBLGen Pro
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 14-Sep-2006 14:54:33   
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 14-Sep-2006 21:22:08   

Thanks! simple_smile

We'll soon have the external resource page up (it gets bumped downwards in the queue but I really will see to it that it gets added soon) which this would be a good addition to simple_smile Drop me a line when the external resource page is up so I get your resources added simple_smile

Frans Bouma | Lead developer LLBLGen Pro
pat
User
Posts: 215
Joined: 02-Mar-2006
# Posted on: 16-Aug-2007 04:04:48   

mihies wrote:

If anybody is interested I crafted some code. Find it here: http://cs.rthand.com/blogs/blog_with_righthand/archive/2006/09/14/Implementing-more-useful-tracing-for-LLBLGenPro-2.0x.aspx

It works super. Thank you simple_smile Patrick