diff --git a/README.md b/README.md index 3a64db1..1e42014 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,28 @@ -# Azure Data Studio - Simple Data Scripter +# Azure Data Studio - Simple Data Scripter -This extension provides a quick and easy way to migrate data between tables by generating insert scripts based on the result sets of a query. It defaults to generating all data from a given table (based on the table selected via a context menu), but the default sql can be modifed to generate subsets of data. +This extension provides a quick and easy way to migrate data between tables by generating insert scripts based on the result sets of a query. It defaults to generating all data from a given table (based on the table selected via a context menu), but the default sql can be modifed to generate subsets of data. ## Installation -The current release is available to [download as a .vsix file](https://github.com/ecirpnaes/SimpleDataScripter/releases/download/0.1.0/simple-data-scripter-0.1.0.vsix) and can be installed by opening the File Menu and selecting `Install Extension from VSIX Package` +The current release is available to [download as a .vsix file](https://github.com/ecirpnaes/SimpleDataScripter/releases/download/0.1.0/simple-data-scripter-0.1.0.vsix) and can be installed by opening the File Menu and selecting `Install Extension from VSIX Package` ## Features -Right-click on a table node to bring up a [`Script Table Data`] context menu. +Right-click on a table node to bring up a [`Script Table Data`] context menu. An input box will open showing the default SQL of selecting all data. You can simply press [Enter] to accept the default or the SQL using a WHERE clause, joins on other tables, etc... Any valid SQL is acceptable. Press [Enter] to run the query. +The data will be scripted to a new SQL Editor window. ![Feature](images/Scripting.gif) ------------------------------------------------------------------------------------------------------------ ## Known Issues -- This has only been tested with the MSSQL provider, i.e. Microsoft SQL Server. If there are any issues found with other flavors of SQL, (MySql, etc..) please report them at https://github.com/ecirpnaes/simple-data-scripter/issues -- Scripting of binary data (binary, varbinary, image) is not currently supported. +- This has only been tested with the MSSQL provider, i.e. Microsoft SQL Server. If there are any issues found with other flavors of SQL, (MySql, etc..) please report them at +- Scripting of binary data (binary, varbinary, image) is not currently supported. ## Unknown Issues -Can be raised here: https://github.com/ecirpnaes/simple-data-scripter/issues +Can be raised here: ## Release Notes ### 0.1.0 -- Initial release. \ No newline at end of file +- Initial release. diff --git a/images/Scripting.gif b/images/Scripting.gif index 9bd8c71..323e33c 100644 Binary files a/images/Scripting.gif and b/images/Scripting.gif differ diff --git a/package.json b/package.json index 857a75d..55505d1 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "version": "0.0.1", "publisher": "seanprice", "repository": "https://github.com/ecirpnaes/SimpleDataScripter.git", + "license": "MIT", "engines": { "vscode": "^1.38.0", "azdata": "*" diff --git a/src/DataScripter.ts b/src/DataScripter.ts index 35b2a2d..c3bba40 100644 --- a/src/DataScripter.ts +++ b/src/DataScripter.ts @@ -65,9 +65,10 @@ export class DataScripter { // do we have an identity column in our resultset? private hasIdentityColumn(): boolean { - return this._resultSet.columnInfo.some(function (column, index, array) { - return column && column.isIdentity; + this._resultSet.columnInfo.forEach(function (column) { + if (column.isIdentity) { return true; } }); + return false; } // construct a temp table based on the metadata from the resultset