diff --git a/.vscode/settings.json b/.vscode/settings.json index e0f9238..8feadc3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,7 @@ "**/.hg": true, "**/CVS": true, "**/.DS_Store": true, - "**/__pycache__":true + "**/__pycache__":true, + "**/.pytest_cache": true } } diff --git a/Oracle/.gitattributes b/Oracle/.gitattributes new file mode 100644 index 0000000..d0df3d7 --- /dev/null +++ b/Oracle/.gitattributes @@ -0,0 +1,2 @@ +# baseline files need to retain crlf for cross plat +*.txt text eol=crlf \ No newline at end of file diff --git a/Oracle/.gitignore b/Oracle/.gitignore new file mode 100644 index 0000000..2f57025 --- /dev/null +++ b/Oracle/.gitignore @@ -0,0 +1,124 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# IPython Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# dotenv +.env + +# virtualenv +venv/ +ENV/ + +# Spyder project settings +.spyderproject + +# Rope project settings +.ropeproject + +# DS Store +.DS_Store + +# sqltoolsservice binaries +/mssqlscripter/sqltoolsservice/* +/mssqlscripter/mssqltoolsservice/bin/* + + +# VSCode configuration +.vscode/* + +# Visual Studio User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# MonoDevelop/Xamarin Studio User-specific files +*.userprefs + +# Visual Studio Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ \ No newline at end of file diff --git a/Oracle/LICENSE.txt b/Oracle/LICENSE.txt new file mode 100644 index 0000000..feb1c47 --- /dev/null +++ b/Oracle/LICENSE.txt @@ -0,0 +1,10 @@ +Mobilize.NET Teradata DDL Exporter + +Copyright (c) Mobilize.NET +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Oracle/MANIFEST.in b/Oracle/MANIFEST.in new file mode 100644 index 0000000..8ce6e32 --- /dev/null +++ b/Oracle/MANIFEST.in @@ -0,0 +1,2 @@ +include oraexport/bin/* +include oraexport/scripts/* \ No newline at end of file diff --git a/Oracle/README.rst b/Oracle/README.rst new file mode 100644 index 0000000..b77952e --- /dev/null +++ b/Oracle/README.rst @@ -0,0 +1,41 @@ +sc-ora-exporter +================ +We’re excited to introduce sc-ora-exporter, a simple tool to help exporting your Oracle Code +so it can be migrated to Snowflake. + + +Installation +------------ + +.. code:: bash + + $ pip install snowconvert-oracle-exporter + +Please refer to the `installation guide`_ for detailed install instructions. + +Usage +----- + +Please refer to the `usage guide`_ for details on options and example usage. + +For general help content, pass in the ``-h`` parameter: + +.. code:: bash + + $ sc-oracle-exporter -h + +Reporting issues and feedback +----------------------------- + +If you encounter any bugs with the tool please file an issue in the +`Issues`_ section of our GitHub repo. + +License +------- + +sc-oracle-exporter is licensed under the `MIT license`_. + +.. _installation guide: https://github.com/MobilizeNet/SnowConvertDDLExportScripts/blob/main/Oracle/doc/installation_guide.md +.. _usage guide: https://github.com/MobilizeNet/SnowConvertDDLExportScripts/blob/main/Oracle/doc/usage_guide.md +.. _Issues: https://github.com/MobilizeNet/SnowConvertDDLExportScripts/issues +.. _MIT license: https://github.com/MobilizeNet/SnowConvertDDLExportScripts/blob/main/Oracle/LICENSE.txt \ No newline at end of file diff --git a/Oracle/oraexport/__init__.py b/Oracle/oraexport/__init__.py new file mode 100644 index 0000000..47c9497 --- /dev/null +++ b/Oracle/oraexport/__init__.py @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Mobilize.NET All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +__version__ = '1.0.0a0' \ No newline at end of file diff --git a/Oracle/oraexport/__main__.py b/Oracle/oraexport/__main__.py new file mode 100644 index 0000000..671b921 --- /dev/null +++ b/Oracle/oraexport/__main__.py @@ -0,0 +1,37 @@ +import teraexport +import argparse +import sys +import os +import stat +from builtins import FileExistsError + +args = sys.argv[1:] +parser = argparse.ArgumentParser( + prog=u'sc-oracle-export', + description=u'Mobilize.NET Oracle Code Export Tools' + + 'Version {}'.format(teraexport.__version__)) + +parser.add_argument( + u'-S', u'--server', + dest=u'Server', + required=True, + metavar=u'', + help=u'Server address. For example: 127.0.0.1') + +parser.add_argument( + u'-U', u'--user', + dest=u'UserId', + metavar=u'', + required=True, + help=u'Login ID for server. Usually it will be the DBC user') + +parser.add_argument( + u'-P', u'--password', + dest=u'Password', + required=True, + metavar=u'', + help=u'The password for the given user.') + +parameters = parser.parse_args(args) + +// TODO in progress \ No newline at end of file diff --git a/Oracle/create_ddls_sql.sql b/Oracle/oraexport/scripts/create_ddls_sql.sql similarity index 100% rename from Oracle/create_ddls_sql.sql rename to Oracle/oraexport/scripts/create_ddls_sql.sql diff --git a/Oracle/pyproject.toml b/Oracle/pyproject.toml new file mode 100644 index 0000000..b5a3c46 --- /dev/null +++ b/Oracle/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel" +] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/Oracle/requirements.txt b/Oracle/requirements.txt new file mode 100644 index 0000000..5bd9bd3 --- /dev/null +++ b/Oracle/requirements.txt @@ -0,0 +1,9 @@ +enum34 >= 1.1.6 +future >= 0.16.0 +setuptools >= 36.0.1 +wheel >= 0.29.0 +coverage >= 4.3.4 +twine >= 1.8.1 +flake8 >= 3.3.0 +pytest >= 3.0.7 +pytest-cov >= 2.5.1 diff --git a/Oracle/sc-oracle-export b/Oracle/sc-oracle-export new file mode 100755 index 0000000..1717f3f --- /dev/null +++ b/Oracle/sc-oracle-export @@ -0,0 +1,15 @@ +#!/bin/bash + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +# Set the python io encoding to UTF-8 by default if not set. +if [ -z ${PYTHONIOENCODING+x} ]; then export PYTHONIOENCODING=utf8; fi + +export PYTHONPATH="${DIR}:${PYTHONPATH}" +python -m oraexport "$@" \ No newline at end of file diff --git a/Oracle/setup.cfg b/Oracle/setup.cfg new file mode 100644 index 0000000..4fe6a8e --- /dev/null +++ b/Oracle/setup.cfg @@ -0,0 +1,55 @@ +[bdist_wheel] +universal =1 + +[metadata] +name = snowconvert-export-oracle +version = 0.0.1a0 +author = Mauricio Rojas +author_email = mauricio.rojas@mobilize.net +description = Mobilize.Net Oracle Export Tool for SnowConvert +long_description = file: README.rst +long_description_content_type = text/x-rst +license_file = LICENSE.txt + +python_requires='>=2.6, >=3' + +url = https://github.com/mobilize/SnowConvertDDLExportScripts/Oracle +project_urls = + Bug Tracker = https://github.com/MobilizeNet/SnowConvertDDLExportScripts/issues +classifiers = + Development Status :: 3 - Alpha + Intended Audience :: Developers + Intended Audience :: System Administrators + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + License :: OSI Approved :: MIT License + +[options] +include_package_data=True +scripts= + sc-oracle-export + sc-oracle-split-ddl +packages = + oraexport + split + +[flake8] +ignore = + # E501: line too long. + E501, + # F401, imported but unused, ignore where we import setup. + F401, + # E402 module level import not at top of file. + # To maintain py2 - 3 compat certain orders of import is necessary. + E402 + +# Explicitly specifying what files/directories we check +# in case user creates a virtual environment in repo, +# forgoing the need for them to modify this file to ignore their venv directory. +filename = + ./oraexport/*.py \ No newline at end of file diff --git a/SQLServer/.gitattributes b/SQLServer/.gitattributes new file mode 100644 index 0000000..d0df3d7 --- /dev/null +++ b/SQLServer/.gitattributes @@ -0,0 +1,2 @@ +# baseline files need to retain crlf for cross plat +*.txt text eol=crlf \ No newline at end of file diff --git a/SQLServer/.gitignore b/SQLServer/.gitignore new file mode 100644 index 0000000..2f57025 --- /dev/null +++ b/SQLServer/.gitignore @@ -0,0 +1,124 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# IPython Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# dotenv +.env + +# virtualenv +venv/ +ENV/ + +# Spyder project settings +.spyderproject + +# Rope project settings +.ropeproject + +# DS Store +.DS_Store + +# sqltoolsservice binaries +/mssqlscripter/sqltoolsservice/* +/mssqlscripter/mssqltoolsservice/bin/* + + +# VSCode configuration +.vscode/* + +# Visual Studio User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# MonoDevelop/Xamarin Studio User-specific files +*.userprefs + +# Visual Studio Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ \ No newline at end of file diff --git a/SQLServer/LICENSE.txt b/SQLServer/LICENSE.txt new file mode 100644 index 0000000..feb1c47 --- /dev/null +++ b/SQLServer/LICENSE.txt @@ -0,0 +1,10 @@ +Mobilize.NET Teradata DDL Exporter + +Copyright (c) Mobilize.NET +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/SQLServer/MANIFEST.in b/SQLServer/MANIFEST.in new file mode 100644 index 0000000..9a875f4 --- /dev/null +++ b/SQLServer/MANIFEST.in @@ -0,0 +1,2 @@ +include sqlexport/bin/* +include sqlexport/scripts/* \ No newline at end of file diff --git a/SQLServer/README.rst b/SQLServer/README.rst new file mode 100644 index 0000000..a294a65 --- /dev/null +++ b/SQLServer/README.rst @@ -0,0 +1,41 @@ +sc-sqlserver-exporter +================ +We’re excited to introduce sc-sqlserver-exporter, a simple tool to help exporting your SQLServer Code +so it can be migrated to Snowflake. + + +Installation +------------ + +.. code:: bash + + $ pip install snowconvert-sqlserver-exporter + +Please refer to the `installation guide`_ for detailed install instructions. + +Usage +----- + +Please refer to the `usage guide`_ for details on options and example usage. + +For general help content, pass in the ``-h`` parameter: + +.. code:: bash + + $ sc-sqlserver-exporter -h + +Reporting issues and feedback +----------------------------- + +If you encounter any bugs with the tool please file an issue in the +`Issues`_ section of our GitHub repo. + +License +------- + +sc-sqlserver-exporter is licensed under the `MIT license`_. + +.. _installation guide: https://github.com/MobilizeNet/SnowConvertDDLExportScripts/blob/main/SQLServer/doc/installation_guide.md +.. _usage guide: https://github.com/MobilizeNet/SnowConvertDDLExportScripts/blob/main/SQLServer/doc/usage_guide.md +.. _Issues: https://github.com/MobilizeNet/SnowConvertDDLExportScripts/issues +.. _MIT license: https://github.com/MobilizeNet/SnowConvertDDLExportScripts/blob/main/SQLServer/LICENSE.txt \ No newline at end of file diff --git a/SQLServer/pyproject.toml b/SQLServer/pyproject.toml new file mode 100644 index 0000000..b5a3c46 --- /dev/null +++ b/SQLServer/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel" +] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/SQLServer/requirements.txt b/SQLServer/requirements.txt new file mode 100644 index 0000000..5bd9bd3 --- /dev/null +++ b/SQLServer/requirements.txt @@ -0,0 +1,9 @@ +enum34 >= 1.1.6 +future >= 0.16.0 +setuptools >= 36.0.1 +wheel >= 0.29.0 +coverage >= 4.3.4 +twine >= 1.8.1 +flake8 >= 3.3.0 +pytest >= 3.0.7 +pytest-cov >= 2.5.1 diff --git a/SQLServer/sc-sqlserver-export b/SQLServer/sc-sqlserver-export new file mode 100755 index 0000000..6436bd1 --- /dev/null +++ b/SQLServer/sc-sqlserver-export @@ -0,0 +1,15 @@ +#!/bin/bash + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +# Set the python io encoding to UTF-8 by default if not set. +if [ -z ${PYTHONIOENCODING+x} ]; then export PYTHONIOENCODING=utf8; fi + +export PYTHONPATH="${DIR}:${PYTHONPATH}" +python -m sqlexport "$@" \ No newline at end of file diff --git a/SQLServer/setup.cfg b/SQLServer/setup.cfg new file mode 100644 index 0000000..5fe862f --- /dev/null +++ b/SQLServer/setup.cfg @@ -0,0 +1,53 @@ +[bdist_wheel] +universal =1 + +[metadata] +name = snowconvert-export-sqlserver +version = 0.0.1a0 +author = Mauricio Rojas +author_email = mauricio.rojas@mobilize.net +description = Mobilize.Net SQLServer Export Tool for SnowConvert +long_description = file: README.rst +long_description_content_type = text/x-rst +license_file = LICENSE.txt + +python_requires='>=2.6, >=3' + +url = https://github.com/mobilize/SnowConvertDDLExportScripts/SQLServer +project_urls = + Bug Tracker = https://github.com/MobilizeNet/SnowConvertDDLExportScripts/issues +classifiers = + Development Status :: 3 - Alpha + Intended Audience :: Developers + Intended Audience :: System Administrators + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + License :: OSI Approved :: MIT License + +[options] +include_package_data=True +scripts= + sc-sqlserver-export +packages = + sqlexport + +[flake8] +ignore = + # E501: line too long. + E501, + # F401, imported but unused, ignore where we import setup. + F401, + # E402 module level import not at top of file. + # To maintain py2 - 3 compat certain orders of import is necessary. + E402 + +# Explicitly specifying what files/directories we check +# in case user creates a virtual environment in repo, +# forgoing the need for them to modify this file to ignore their venv directory. +filename = + ./sqlexport/*.py \ No newline at end of file diff --git a/SQLServer/sqlexport/__init__.py b/SQLServer/sqlexport/__init__.py new file mode 100644 index 0000000..47c9497 --- /dev/null +++ b/SQLServer/sqlexport/__init__.py @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Mobilize.NET All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +__version__ = '1.0.0a0' \ No newline at end of file diff --git a/SQLServer/sqlexport/__main__.py b/SQLServer/sqlexport/__main__.py new file mode 100644 index 0000000..3eea00a --- /dev/null +++ b/SQLServer/sqlexport/__main__.py @@ -0,0 +1,37 @@ +import teraexport +import argparse +import sys +import os +import stat +from builtins import FileExistsError + +args = sys.argv[1:] +parser = argparse.ArgumentParser( + prog=u'sc-sqlserver-export', + description=u'Mobilize.NET SQLServer Code Export Tools' + + 'Version {}'.format(teraexport.__version__)) + +parser.add_argument( + u'-S', u'--server', + dest=u'Server', + required=True, + metavar=u'', + help=u'Server address. For example: 127.0.0.1') + +parser.add_argument( + u'-U', u'--user', + dest=u'UserId', + metavar=u'', + required=True, + help=u'Login ID for server. Usually it will be the DBC user') + +parser.add_argument( + u'-P', u'--password', + dest=u'Password', + required=True, + metavar=u'', + help=u'The password for the given user.') + +parameters = parser.parse_args(args) + +// TODO in progress \ No newline at end of file