diff --git a/.bumpversion.cfg b/.bumpversion.cfg index cbcee84..abb3a30 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,6 +1,5 @@ [bumpversion] -current_version = 1.0.0a22 - +current_version = 1.0.0a23 parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?P[a-z]+))(?P\d+) serialize = {major}.{minor}.{patch}{release}{release_version} diff --git a/README.rst b/README.rst index 94a1cb7..7be18a7 100644 --- a/README.rst +++ b/README.rst @@ -15,6 +15,16 @@ mssql-scripter =============== + +PROJECT STATUS +-------------- + +**This tool is no longer actively maintained.** Microsoft SQL Server Management Studio provides +a Generate Scripts Wizard that provides similar functionality to mssql-scripter. + +Description +----------- + We’re excited to introduce mssql-scripter, a multi-platform command line experience for scripting SQL Server databases. @@ -63,7 +73,7 @@ opencode@microsoft.com with any additional questions or comments. License ------- -mssql-scritper is licensed under the `MIT license`_. +mssql-scripter is licensed under the `MIT license`_. .. _installation guide: doc/installation_guide.md .. _development guide: doc/development_guide.md @@ -71,4 +81,4 @@ mssql-scritper is licensed under the `MIT license`_. .. _Issues: https://github.com/Microsoft/mssql-scripter/issues .. _Microsoft Open Source Code of Conduct: https://opensource.microsoft.com/codeofconduct/ .. _Code of Conduct FAQ: https://opensource.microsoft.com/codeofconduct/faq/ -.. _MIT license: https://github.com/Microsoft/mssql-scripter/blob/dev/LI +.. _MIT license: https://github.com/Microsoft/mssql-scripter/blob/dev/LICENSE.txt diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..869fdfe --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + diff --git a/build.py b/build.py index c2ac964..833a756 100644 --- a/build.py +++ b/build.py @@ -152,10 +152,8 @@ def publish_official(platforms_names): supported_platforms = [ 'win32', 'win_amd64', - 'win64', 'macosx_10_11_intel', - 'manylinux1_x86_64', - 'manylinux1_i686'] + 'manylinux1_x86_64'] targets = { 'build': build, diff --git a/doc/documentation_page.md b/doc/documentation_page.md index 5d93df3..acb476b 100644 --- a/doc/documentation_page.md +++ b/doc/documentation_page.md @@ -79,7 +79,7 @@ You can set environment variables for your connection string through the followi mssql-scripter # set environment variable MSSQL_SCRIPTER_PASSWORD so no password input is required. - export MSSQL_SCRIPTER_PASSWORD='ABC123' + export MSSQL_SCRIPTER_PASSWORD='[PLACEHOLDER]' mssql-scripter -S localhost -d AdventureWorks -U sa ## Generate and run scripts diff --git a/doc/usage_guide.md b/doc/usage_guide.md index 22a5e7f..d51f165 100644 --- a/doc/usage_guide.md +++ b/doc/usage_guide.md @@ -141,9 +141,9 @@ For option parameters, pass in '-h': ## Examples Below are example commands that run against the AdventureWorks database. Here is the list of examples: -[Dump datbase object schema](#dump-database-object-schema) +[Dump database object schema](#dump-database-object-schema) -[Dump datbase object data](#dump-database-object-data) +[Dump database object data](#dump-database-object-data) [Dump database object schema and data](#dump-the-database-object-schema-and-data) @@ -151,6 +151,8 @@ Below are example commands that run against the AdventureWorks database. Here is [Exclude database objects](#exclude-database-objects) +[Include database object types](#include-database-object-types) + [Target server version](#target-server-version) [Target server edition](#target-server-edition) @@ -159,6 +161,9 @@ Below are example commands that run against the AdventureWorks database. Here is [Script data to a file](#script-data-to-a-file) + + + ### Dump database object schema # generate DDL scripts for all objects in the Adventureworks database and save the script to a file @@ -193,6 +198,13 @@ Below are example commands that run against the AdventureWorks database. Here is # generate DDL scripts for objects that do not contain 'Sale' in their name to stdout mssql-scripter -S localhost -d AdventureWorks -U sa --exclude-objects Sale +### Include database object types + + # generate DDL scripts for stored procedures to stdout + # The list of object types is specified in the DatabaseObjectTypes Enum of Microsoft.SqlServer.Management.Smo + # https://docs.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.management.smo.databaseobjecttypes?view=sql-smo-160 + mssql-scripter -S localhost -d AdventureWorks -U sa --include-types StoredProcedure + ### Target server version # specify the version of SQL Server the script will be run against @@ -215,15 +227,28 @@ Note this example is for Linux and macOS usage. # script all the data to a file. mssql-scripter -S localhost -d AdventureWorks -U sa --data-only > ./adventureworks-data.sql + ## Environment Variables You can set environment variables for your connection string through the following steps: + # (linux/bash) # set environment variable MSSQL_SCRIPTER_CONNECTION_STRING with a connection string. $ export MSSQL_SCRIPTER_CONNECTION_STRING='Server=myserver;Database=mydb;User Id=myuser;Password=mypassword;' $ mssql-scripter + # (linux/bash) # set environment variable MSSQL_SCRIPTER_PASSWORD so no password input is required. - $ export MSSQL_SCRIPTER_PASSWORD='ABC123' + $ export MSSQL_SCRIPTER_PASSWORD='[PLACEHOLDER]' $ mssql-scripter -S localhost -d AdventureWorks -U sa + + # (windows) + # set environment variable MSSQL_SCRIPTER_CONNECTION_STRING with a connection string. + $Env:MSSQL_SCRIPTER_CONNECTION_STRING = 'Server=myserver;Database=mydb;User Id=myuser;Password=mypassword;' + mssql-scripter + + # (windows) + # set environment variable MSSQL_SCRIPTER_PASSWORD so no password input is required. + $Env:MSSQL_SCRIPTER_PASSWORD = "placeholder" + mssql-scripter -S localhost -d AdventureWorks -U sa diff --git a/mssql-scripter.pyproj b/mssql-scripter.pyproj index 9c31b76..9d6174f 100644 --- a/mssql-scripter.pyproj +++ b/mssql-scripter.pyproj @@ -66,13 +66,10 @@ - - - - + + - @@ -83,8 +80,7 @@ - - + \ No newline at end of file diff --git a/mssqlscripter/__init__.py b/mssqlscripter/__init__.py index cdc2fbf..bc04eba 100644 --- a/mssqlscripter/__init__.py +++ b/mssqlscripter/__init__.py @@ -4,4 +4,4 @@ # -------------------------------------------------------------------------------------------- -__version__ = '1.0.0a22' +__version__ = '1.0.0a23' diff --git a/mssqlscripter/mssqltoolsservice/external.py b/mssqlscripter/mssqltoolsservice/external.py index dc89622..d59f3bd 100644 --- a/mssqlscripter/mssqltoolsservice/external.py +++ b/mssqlscripter/mssqltoolsservice/external.py @@ -18,12 +18,10 @@ # Supported platform key's must match those in mssqlscript's setup.py. SUPPORTED_PLATFORMS = { - 'manylinux1_x86_64': SQLTOOLSSERVICE_BASE + 'manylinux1/' + 'Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.0.tar.gz', - 'manylinux1_i686': SQLTOOLSSERVICE_BASE + 'manylinux1/' + 'Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.0.tar.gz', - 'macosx_10_11_intel': SQLTOOLSSERVICE_BASE + 'macosx_10_11_intel/' + 'Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.0.tar.gz', - 'win_amd64': SQLTOOLSSERVICE_BASE + 'win64/' + 'Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.0.zip', - 'win64': SQLTOOLSSERVICE_BASE + 'win64/' + 'Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.0.zip', - 'win32': SQLTOOLSSERVICE_BASE + 'win32/' + 'Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.0.zip' + 'manylinux1_x86_64': SQLTOOLSSERVICE_BASE + 'manylinux1/' + 'Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.1.tar.gz', + 'macosx_10_11_intel': SQLTOOLSSERVICE_BASE + 'macosx_10_11_intel/' + 'Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.1.tar.gz', + 'win_amd64': SQLTOOLSSERVICE_BASE + 'win_amd64/' + 'Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.1.zip', + 'win32': SQLTOOLSSERVICE_BASE + 'win32/' + 'Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.1.zip' } TARGET_DIRECTORY = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', 'bin')) @@ -39,7 +37,7 @@ def copy_sqltoolsservice(platform): if not platform or platform not in SUPPORTED_PLATFORMS: print('{} is not supported.'.format(platform)) print('Please provide a valid platform flag.' + - '[win32, win_amd64, win64, manylinux1_x86_64, manylinux1_i686, macosx_10_11_intel]') + '[win32, win_amd64, manylinux1_x86_64, macosx_10_11_intel]') sys.exit(1) copy_file_path = SUPPORTED_PLATFORMS[platform] diff --git a/mssqlscripter/tests/test_argparser.py b/mssqlscripter/tests/test_argparser.py index 74af7a0..6c46fca 100644 --- a/mssqlscripter/tests/test_argparser.py +++ b/mssqlscripter/tests/test_argparser.py @@ -29,20 +29,20 @@ def test_connection_string_builder(self): standard_connection = [u'-S', u'TestServer', u'-d', u'mydatabase', u'-U', 'my_username', u'-P', 'secret'] parameters = parser.parse_arguments(standard_connection) - self.assertEqual(parameters.ConnectionString, u'Server=TestServer;Database=mydatabase;User Id=my_username;Password=secret;') + self.assertEqual(parameters.ConnectionString, u'Server=TestServer;Database=mydatabase;User Id=my_username;Password=PLACEHOLDER;') def test_connection_string_with_environment(self): """ Verify parser picks up connection string and password from environment variable. """ - os.environ[parser.MSSQL_SCRIPTER_CONNECTION_STRING] = u'Server=TestServer;Database=mydatabase;User Id=my_username;Password=secret;' + os.environ[parser.MSSQL_SCRIPTER_CONNECTION_STRING] = u'Server=TestServer;Database=mydatabase;User Id=my_username;Password=PLACEHOLDER;' parameters = parser.parse_arguments(['--append']) - self.assertEqual(parameters.ConnectionString, u'Server=TestServer;Database=mydatabase;User Id=my_username;Password=secret;') + self.assertEqual(parameters.ConnectionString, u'Server=TestServer;Database=mydatabase;User Id=my_username;Password=PLACEHOLDER;') standard_connection = [u'-S', u'TestServer', u'-d', u'mydatabase', u'-U', 'my_username'] - os.environ[parser.MSSQL_SCRIPTER_PASSWORD] = u'secret123ABC' + os.environ[parser.MSSQL_SCRIPTER_PASSWORD] = u'PLACEHOLDER' parameters = parser.parse_arguments(standard_connection) - self.assertEqual(parameters.ConnectionString, u'Server=TestServer;Database=mydatabase;User Id=my_username;Password=secret123ABC;') + self.assertEqual(parameters.ConnectionString, u'Server=TestServer;Database=mydatabase;User Id=my_username;Password=PLACEHOLDER;') if __name__ == u'__main__': diff --git a/setup.py b/setup.py index ed238a1..3c22de0 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ from setuptools import setup -MSSQLSCRIPTER_VERSION = '1.0.0a22' +MSSQLSCRIPTER_VERSION = '1.0.0a23' CLASSIFIERS = [ 'Development Status :: 3 - Alpha', diff --git a/sqltoolsservice/win32/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.0.zip b/sqltoolsservice/macosx_10_11_intel/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.1.tar.gz similarity index 74% rename from sqltoolsservice/win32/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.0.zip rename to sqltoolsservice/macosx_10_11_intel/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.1.tar.gz index 8ffe063..4a0c1c9 100644 Binary files a/sqltoolsservice/win32/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.0.zip and b/sqltoolsservice/macosx_10_11_intel/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.1.tar.gz differ diff --git a/sqltoolsservice/manylinux1/Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.0.tar.gz b/sqltoolsservice/manylinux1/Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.1.tar.gz similarity index 71% rename from sqltoolsservice/manylinux1/Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.0.tar.gz rename to sqltoolsservice/manylinux1/Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.1.tar.gz index 13ccae9..e905b48 100644 Binary files a/sqltoolsservice/manylinux1/Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.0.tar.gz and b/sqltoolsservice/manylinux1/Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.1.tar.gz differ diff --git a/sqltoolsservice/win64/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.0.zip b/sqltoolsservice/win32/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.1.zip similarity index 74% rename from sqltoolsservice/win64/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.0.zip rename to sqltoolsservice/win32/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.1.zip index 3904548..9d02010 100644 Binary files a/sqltoolsservice/win64/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.0.zip and b/sqltoolsservice/win32/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.1.zip differ diff --git a/sqltoolsservice/macosx_10_11_intel/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.0.tar.gz b/sqltoolsservice/win_amd64/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.1.zip similarity index 66% rename from sqltoolsservice/macosx_10_11_intel/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.0.tar.gz rename to sqltoolsservice/win_amd64/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.1.zip index 2d1977b..f2c1292 100644 Binary files a/sqltoolsservice/macosx_10_11_intel/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.0.tar.gz and b/sqltoolsservice/win_amd64/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.1.zip differ