I just added a new Debug Visualizer for viewing TDataSet descendants (currently supports ADODB/FireDac/ClientDataSet) The normal debug visualizer shares data between the end process and Debugger via Evaluate() returning a string... this takes a different approach and exports the dataset to a temporary file via .SaveToFile and then populates a temporary dataset via .LoadFromFile. This is obviously not real nice for huge datasets...but could be useful for others.


I just added a new Debug Visualizer for viewing TDataSet descendants (currently supports ADODB/FireDac/ClientDataSet)  The normal debug visualizer shares data between the end process and Debugger via Evaluate() returning a string... this takes a different approach and exports the dataset to a temporary file via .SaveToFile and then populates a temporary dataset via .LoadFromFile.  This is obviously not real nice for huge datasets...but could be useful for others.
#Delphi10Seattle   Suggested today by Tom Field.
https://github.com/darianmiller/dxIDEPackage_TDataSetVisualizer

Comments

  1. Darian Miller Nice package, thanks. Good to see Delphi open source projects! Added TClientDataset support and sent a PR, hope it's welcome: https://github.com/darianmiller/dxIDEPackage_TDataSetVisualizer/pull/1

    ReplyDelete
  2. Thanks Fábio Gomes ... merged your pull request in, so this optionally supports TDataSet descendants from: ADO, FireDAC, and now ClientDataSet.  Also now has XE7 project files.

    ReplyDelete
  3. Fixed reported issue with FireDAC descendants of TDataSets other than TFDMemTable (which I had originally tested.)  Both the Visualizer and the debugged application need a TFDStanStorageXxxLink registered.  I added "FireDAC.Stan.StorageBin" to the Visualizer for the 'Export' button functionality and added an error message if SaveToFile fails as a reminder that it's needed within the Debugged application.

    ReplyDelete
  4. Very nice, Darian! Thanks for responding to my suggestion. I'll use this tool daily.

    ReplyDelete
  5. Tom Field It was a good idea of yours!  Glad it works for you after a fix was made.  I updated the ReadMe based on your usage notes.

    ReplyDelete
  6. Great idea. My only worry is how much refresh is done while you step in the code... as the debug views tend to get refreshed frequently.

    ReplyDelete
  7. Marco Cantù Agreed, I wouldn't recommend leaving the visualizer open while stepping through the code. I imagine it's more of a "what's in there at this point in time" type one-off inspection.  I also wonder how it's going to affect the ongoing operation of the dataset once it's been inspected (behavioral changes in the app)... If it works out, then we have a handy tool.  If it fails miserably - it was Tom's idea!  : }

    ReplyDelete
  8. Awesome... It delivers what is needed.

    ReplyDelete
  9. Darian Miller another side effect of the visualizer is that is changes the cursor position as it saves the dataset to file. I think it would be useful to add this info in the project's readme, as if you are debugging in an event like BeforePost, this visualizer will change your dataset's cursor position.

    ReplyDelete
  10. Hi guys, I haven't seen the code myself, but probably a simple bookmark can fix this side effect?

    ReplyDelete
  11. Darian Miller yes, good point. For one time snap shot it is really a great idea.

    ReplyDelete
  12. BTW, there are a fe visualizers floating around: this one, on for JSON, one for XML, one for bitmap... would be great to consolidate them in a single pack!

    ReplyDelete
  13. One big side effect tackled on the latest commit - if the DataSet is not currently in "Browse" mode then the .SaveToFile method is not called. (If in Edit/Insert mode it could cause a Post.)  Also added some Debug messages to remind users that every time the Visualizer is refreshed, the data is exported.

    ReplyDelete
  14. Why not take the inspected dataset directly and attach it to the grid/datasource? That would instantly give support for any dataset.

    ReplyDelete
  15. Marco Cantù i remember when the concept was introduced. I'm still asking myself why more of them are not deliviered with the product? Competitive products (albeit perhaps in a more constricted environ) do this quite excellently. This example is gold. IBO for instance have a parallell BufferXxxx set of methods to aid in solving problems like above. If Emb did it the snap/buffer concept would be a part of TDataset? No?

    ReplyDelete
  16. Darian just added a new capability I suggested. The visualizer now displays the SQL.Text property below the grid. Nice addition.

    I'd never used github before this. I was surprised how easy it was to setup and use.

    ReplyDelete

Post a Comment