Suggestion: After Generating DDL Commands open SQL in Editor or Explorer

Posts   
 
    
rstrahl
User
Posts: 17
Joined: 24-Aug-2009
# Posted on: 15-Sep-2019 21:52:42   

I like that the designer doesn't update the database directly and instead generates scripts, which is the way I typically work anyway. Great.

I would like however, to see the changes (optionally) after I've created a Create/Update script.

It would be nice if that dialog at the end of generating scripts had an option to either Open the Sql (ie. ShellExecute the SQL Script) or maybe more safely open Explorer with the file selected so you can manually shell exec it or open it in an editor.

IAC, any way to quickly link or show the script to actually executing on my terms seems useful because currently it doesn't even tell you where the file was generated and you have to remember and hunt for the folder specified in the settings.

BTW, that folder by default is not set - so it errors out the first time you run. I think it'd be good to set that a default location in the project like Generated Scripts.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 16-Sep-2019 10:50:47   

In the next version (v5.7) we're planning to add a sql editor/runner so you can run scripts inside the designer on the database known in the project. It's primarily meant for this occasion indeed, the script that's generated and you want to run it, or also e.g. run a query over the entities that are in the model. simple_smile

Default folders is a good suggestion, we'll take that into account for a future version. Thing is with default folders and generated code, if the user doesn't pay attention where things are generated (and the initial setup, if everything is ready to rock, the user just hits enter for instance), they get files generated somewhere but it's then a struggle where.

That said however, there's a grey area between not having any default and a sucky default so we'll see what we can do. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
rstrahl
User
Posts: 17
Joined: 24-Aug-2009
# Posted on: 17-Sep-2019 21:22:40   

In the next version (v5.7) we're planning to add a sql editor/runner so you can run scripts inside the designer on the database known in the project. It's primarily meant for this occasion indeed, the script that's generated and you want to run it, or also e.g. run a query over the entities that are in the model.

Nice! That will solve the immediate execution problem and also let you copy the SQL and paste it into other tools I presume.

FWIW, a good way how this is sort of thing is done is in the RedGate tools like SQL Compare. The completion dialogs gives your the running changes summary and then has options to open the script, copy to clipboard or execute it (with an editor similar to what you're proposing). I find with this sort of thing I use all those options from time to time.

+++ Rick ---

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 18-Sep-2019 09:25:25   

That's indeed a good set of options to have! simple_smile We'll try to implement them too simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 11-Dec-2019 16:43:23   

For v5.7 we've implemented: - a SQL editor with execution of the sql in the editor, or parts of it (selection) as a single statement or batch (multiple statements), with multiple resultset retrieval support and transaction support. You can cancel a long running query too. - After a sql script has been generated you get a dialog with the choice to view the log (like it does now), open it in the new sql editor, open it in the associated app (e.g. smss) or open the folder it's in. (Or nothing and simply close it) - We added settings for default destination folders for ddl sql scripts and also sourcecode so starting a project and generating these for the first time won't give error-ed tasks anymore.

Again, thanks for the feedback!

Frans Bouma | Lead developer LLBLGen Pro