@@ -896,11 +896,11 @@ const generate_sql_ddl_1 = require("@funktechno/little-mermaid-2-the-sql/lib/src
896896const sqlsimpleparser_1 = require ( "@funktechno/sqlsimpleparser" ) ;
897897/**
898898 * SQL Tools Plugin for importing diagrams from SQL DDL and exporting to SQL.
899- * Version: 0.0.1
899+ * Version: 0.0.2
900900 */
901901Draw . loadPlugin ( function ( ui ) {
902902 // export sql methods
903- const pluginVersion = "0.0.1 " ;
903+ const pluginVersion = "0.0.2 " ;
904904 //Create Base div
905905 const divGenSQL = document . createElement ( "div" ) ;
906906 divGenSQL . style . userSelect = "none" ;
@@ -917,7 +917,7 @@ Draw.loadPlugin(function (ui) {
917917 const theMenuExportAs = ui . menus . get ( "exportAs" ) ;
918918 let buttonLabel = "tosql=To SQL" ;
919919 // vscode extension support
920- if ( ! ( theMenuExportAs && theMenuExportAs . enabled ) ) {
920+ if ( ! ( theMenuExportAs && ! window . VsCodeApi ) ) {
921921 buttonLabel = "tosql=Export As SQL" ;
922922 }
923923 // Extends Extras menu
@@ -1242,10 +1242,10 @@ Draw.loadPlugin(function (ui) {
12421242 const sqlInputFromSQL = document . createElement ( "textarea" ) ;
12431243 sqlInputFromSQL . style . height = "200px" ;
12441244 sqlInputFromSQL . style . width = "100%" ;
1245- const defaultReset = " /*\n\tDrawio default value\n\tPlugin: sql\n\tVersion: ${pluginVersion}\n*/\n\nCREATE TABLE Persons\n(\n PersonID int NOT NULL,\n LastName varchar(255),\n " +
1246- "FirstName varchar(255),\n Address varchar(255),\n City varchar(255),\n Primary Key(PersonID)\n);\n\n" +
1247- "CREATE TABLE Orders\n(\n OrderID int NOT NULL PRIMARY KEY,\n PersonID int NOT NULL,\n FOREIGN KEY ([PersonID]) REFERENCES [Persons]([PersonID])" +
1248- "\n);" ;
1245+ const defaultReset = ` /*\n\tDrawio default value\n\tPlugin: sql\n\tVersion: ${ pluginVersion } \n*/\n\nCREATE TABLE Persons\n(\n PersonID int NOT NULL,\n LastName varchar(255),\n " +
1246+ "FirstName varchar(255),\n Address varchar(255),\n City varchar(255),\n Primary Key(PersonID)\n);\n\n" +
1247+ "CREATE TABLE Orders\n(\n OrderID int NOT NULL PRIMARY KEY,\n PersonID int NOT NULL,\n FOREIGN KEY ([PersonID]) REFERENCES [Persons]([PersonID])" +
1248+ "\n);` ;
12491249 sqlInputFromSQL . value = defaultReset ;
12501250 mxUtils . br ( divFromSQL ) ;
12511251 divFromSQL . appendChild ( sqlInputFromSQL ) ;
@@ -1445,7 +1445,7 @@ Draw.loadPlugin(function (ui) {
14451445 ui . menus . addMenuItems ( menu , [ "fromSql" ] , parent ) ;
14461446 } ;
14471447 }
1448- if ( theMenuExportAs && theMenuExportAs . enabled ) {
1448+ if ( theMenuExportAs && ! window . VsCodeApi ) {
14491449 var oldMenuExportAs = theMenuExportAs . funct ;
14501450 theMenuExportAs . funct = function ( ...args ) {
14511451 const [ menu , parent ] = args ;
0 commit comments