{ "info": { "author": "Russell Troxel", "author_email": "russelltroxel@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Topic :: Database :: Front-Ends" ], "description": "# MS-SQL Command Line Interface (mssqlcli)\n\n[![PyPI](https://img.shields.io/pypi/v/mssqlcli.svg)](https://pypi.python.org/pypi/mssqlcli)\n[![Build Status](https://img.shields.io/travis/rtrox/mssqlcli/master.svg)](https://travis-ci.org/rtrox/mssqlcli)\n[![Coverage Status](https://img.shields.io/coveralls/rtrox/mssqlcli/master.svg)](https://coveralls.io/github/rtrox/mssqlcli?branch=master)\n\nMS-SQL CLI is a unix command line tool for accessing and running arbitrary\nqueries against an Microsoft SQL database.\n\n\n## Binary Dependencies\n\n- [FreeTDS][1] - Binary Library providing access to MSSQL and Sybase DBs.\n\n\n\n## Installation\n\n1. Install the FreeTDS Library\n - Debian/Ubuntu: `sudo apt-get install freetds-dev`\n - Mac OSX: `brew install freetds`\n2. Install mssqlcli\n - `pip install mssqlcli`\n*OR*\n - Clone and `python setup.py install`\n\n### DB_VERSION_80 Errors during Installation (OS X)\n\nOn Mac OS X, there is a bug with `pymssql` v2.1.2 which may cause this error:\n```bash\nerror: use of undeclared identifier 'DBVERSION_80'\n```\nIf you see this error, simply install the latest version of `pymssql` from git prior to installation of mssqlcli:\n```bash\npip install -e git+https://github.com/pymssql/pymssql.git#egg=pymssql-2.1.2\n```\n\n\n## Configuration\n\nConfiguration is handled with a single YAML configuration file, located by\ndefault at `~/.config/mssqlcli.yml`.\n\nExample Config:\n```yaml\nkeyring_app_name: another_app # Optional, defaults to mssqlcli\nusername: USE_KEYRING(\"global:LDAPUser\")\npassword: USE_KEYRING(\"global:LDAP\")\n# OR\n# username: my_plaintext_username\n# password: my_plaintext_password\nserver: MY_MSSQL.example.com\n\n# The below is optional, and should be used if\n# Windows Auth will be used instead of MSSQL Auth.\nwindows_authentication: true\ndomain: MY_DOMAIN\n```\n\n\n## Usage\n\n```bash\n~ [ mssqlcli --help Usage: mssqlcli [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n --version Show the version and exit.\n -c, --config-file PATH Override default config file location\n (default: ~/.config/pymssql.yml).\n -o, --output [json|csv|pretty]\n --help Show this message and exit.\n\nCommands:\n query Run a query against an MS-SQL Database.\n template_query\n\n~ [ mssqlcli query --help\nUsage: mssqlcli query [OPTIONS] QUERY\n\nOptions:\n --help Show this message and exit.\n\n~ [ mssqlcli template_query --help\nUsage: mssqlcli template_query [OPTIONS] QUERY\n\nOptions:\n -v, --variable TEXT Variable for substitution in template. ex:\"-v\n first_name:russell\" to replace {{ first_name }}\n --help Show this message and exit.\n```\n\n\n## Examples\nThe general usage model is to store your SQL queries in flat files, and\naccess them with the CLI client. Personally, I store my queries in\n~/sql_queries.\n\n\nRun Query and return results as a json blob\n```bash\nmssqlcli query {path to query}.sql\n```\n\nRun query and return results in CSV format\n```bash\nmssqlcli -o csv query {path to query}.sql\n```\n\nRedirect csv to File\n```bash\nmssqlcli -o csv query {path to query}.sql > results.csv\n```\n\nRun query and return results as a json blob\n```bash\nmssqlcli -o json query {path to query}.sql\n```\n\nSend a template query to the server in file {path to query}.sql.\n```bash\nmssqlcli template_query -v 'last_name: Ugur' {path to query}.sql\n```\n\n### Template Queries\nAn example of a templated SQL query is also given below. These are\nthe kind of queries that can be used alongside template_query command.\n```bash\nSELECT * FROM bogus_db.users WHERE last_name = '{{ last_name }}';\n```\n\n\n[1]: http://www.freetds.org/\n[2]: http://pymssql.org/en/stable/\n[3]: http://click.pocoo.org/5/\n[4]: https://github.com/pymssql/pymssql/issues/432\n\n# MS-SQL Command Line Interface (mssqlcli)\n\n[![PyPI](https://img.shields.io/pypi/v/mssqlcli.svg)](https://pypi.python.org/pypi/mssqlcli)\n[![Build Status](https://img.shields.io/travis/rtrox/mssqlcli/master.svg)](https://travis-ci.org/rtrox/mssqlcli)\n[![Coverage Status](https://img.shields.io/coveralls/rtrox/mssqlcli/master.svg)](https://coveralls.io/github/rtrox/mssqlcli?branch=master)\n\nMS-SQL CLI is a unix command line tool for accessing and running arbitrary\nqueries against an Microsoft SQL database.\n\n\n## Binary Dependencies\n\n- [FreeTDS][1] - Binary Library providing access to MSSQL and Sybase DBs.\n\n\n\n## Installation\n\n1. Install the FreeTDS Library\n - Debian/Ubuntu: `sudo apt-get install freetds-dev`\n - Mac OSX: `brew install freetds`\n2. Install mssqlcli\n - `pip install mssqlcli`\n*OR*\n - Clone and `python setup.py install`\n\n### DB_VERSION_80 Errors during Installation (OS X)\n\nOn Mac OS X, there is a bug with `pymssql` v2.1.2 which may cause this error:\n```bash\nerror: use of undeclared identifier 'DBVERSION_80'\n```\nIf you see this error, simply install the latest version of `pymssql` from git prior to installation of mssqlcli:\n```bash\npip install -e git+https://github.com/pymssql/pymssql.git#egg=pymssql-2.1.2\n```\n\n\n## Configuration\n\nConfiguration is handled with a single YAML configuration file, located by\ndefault at `~/.config/mssqlcli.yml`.\n\nExample Config:\n```yaml\nkeyring_app_name: another_app # Optional, defaults to mssqlcli\nusername: USE_KEYRING(\"global:LDAPUser\")\npassword: USE_KEYRING(\"global:LDAP\")\n# OR\n# username: my_plaintext_username\n# password: my_plaintext_password\nserver: MY_MSSQL.example.com\n\n# The below is optional, and should be used if\n# Windows Auth will be used instead of MSSQL Auth.\nwindows_authentication: true\ndomain: MY_DOMAIN\n```\n\n\n## Usage\n\n```bash\n~ [ mssqlcli --help Usage: mssqlcli [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n --version Show the version and exit.\n -c, --config-file PATH Override default config file location\n (default: ~/.config/pymssql.yml).\n -o, --output [json|csv|pretty]\n --help Show this message and exit.\n\nCommands:\n query Run a query against an MS-SQL Database.\n template_query\n\n~ [ mssqlcli query --help\nUsage: mssqlcli query [OPTIONS] QUERY\n\nOptions:\n --help Show this message and exit.\n\n~ [ mssqlcli template_query --help\nUsage: mssqlcli template_query [OPTIONS] QUERY\n\nOptions:\n -v, --variable TEXT Variable for substitution in template. ex:\"-v\n first_name:russell\" to replace {{ first_name }}\n --help Show this message and exit.\n```\n\n\n## Examples\nThe general usage model is to store your SQL queries in flat files, and\naccess them with the CLI client. Personally, I store my queries in\n~/sql_queries.\n\n\nRun Query and return results as a json blob\n```bash\nmssqlcli query {path to query}.sql\n```\n\nRun query and return results in CSV format\n```bash\nmssqlcli -o csv query {path to query}.sql\n```\n\nRedirect csv to File\n```bash\nmssqlcli -o csv query {path to query}.sql > results.csv\n```\n\nRun query and return results as a json blob\n```bash\nmssqlcli -o json query {path to query}.sql\n```\n\nSend a template query to the server in file {path to query}.sql.\n```bash\nmssqlcli template_query -v 'last_name: Ugur' {path to query}.sql\n```\n\n### Template Queries\nAn example of a templated SQL query is also given below. These are\nthe kind of queries that can be used alongside template_query command.\n```bash\nSELECT * FROM bogus_db.users WHERE last_name = '{{ last_name }}';\n```\n\n\n[1]: http://www.freetds.org/\n[2]: http://pymssql.org/en/stable/\n[3]: http://click.pocoo.org/5/\n[4]: https://github.com/pymssql/pymssql/issues/432\n\n# Contributing\n\nMS-SQL CLI is an open-source project, hosted [on GitHub][1]. All Contributors\nare welcome, a current list of open issues is available [here][2].\n\n## Development Environment\n\nNo additional dependencies are required for development, simply follow the\nstandard installation instructions from README.md. I recommend that you use\n`python setup.py develop`, rather than `install` to allow quick code changes.\n\n## Testing\n\nTo test your code prior to submission, simply:\n\n```bash\npython setup.py test\n```\n\nThis will ensure that tox and virtualenv are installed, and then run the test\nsuite against the interpreters available locally.\n\n## Acceptance Criteria\n\n### Pull requests should be made against the `develop` branch.\nThis repository utilizes git-flow for the most part. as such, new PRs should be\nmade against the `develop` branch. Changes will be merged from `develop` into\nmaster during releases.\n\n### Pull requests should follow full pep8 guidelines (the above testing will verify this).\n\n### Pull requests should have thought-out test cases for any new code.\nTest Coverage is currently at 100%. Pull requests should not reduce this\ncoverage, and should contain thought out test cases for new code.\n\n### Pull requests should contain only a single commit (please squash commits prior to submitting Pull Request)\nPull Requests will be merged via rebase, as we use gitchangelog to generate\nchangelogs. As such, The commit message in your pull request should describe\nwhat is being changed, and should follow the gitchangelog commit message\nspecs (below).\n\n### Pull request commit messages should follow GitChangeLog specifications\nThese specifications can be found [here][3].\n\n\nAs an example, if I was fixing documentation, I might create the following commit text:\n\n```fix: doc: Fixed Installation Instructions to reference proper pip package.```\n\n\nThe above requirements are verified via Travis-CI and Coveralls for Python versions 2.7, 3.4, and 3.5.\n\n\n[1]: https://github.com/rtrox/mssqlcli\n[2]: https://github.com/rtrox/mssqlcli/issues\n[3]: https://github.com/vaab/gitchangelog/blob/master/gitchangelog.rc.reference\n\n# Contributing\n\nMS-SQL CLI is an open-source project, hosted [on GitHub][1]. All Contributors\nare welcome, a current list of open issues is available [here][2].\n\n## Development Environment\n\nNo additional dependencies are required for development, simply follow the\nstandard installation instructions from README.md. I recommend that you use\n`python setup.py develop`, rather than `install` to allow quick code changes.\n\n## Testing\n\nTo test your code prior to submission, simply:\n\n```bash\npython setup.py test\n```\n\nThis will ensure that tox and virtualenv are installed, and then run the test\nsuite against the interpreters available locally.\n\n## Acceptance Criteria\n\n### Pull requests should be made against the `develop` branch.\nThis repository utilizes git-flow for the most part. as such, new PRs should be\nmade against the `develop` branch. Changes will be merged from `develop` into\nmaster during releases.\n\n### Pull requests should follow full pep8 guidelines (the above testing will verify this).\n\n### Pull requests should have thought-out test cases for any new code.\nTest Coverage is currently at 100%. Pull requests should not reduce this\ncoverage, and should contain thought out test cases for new code.\n\n### Pull requests should contain only a single commit (please squash commits prior to submitting Pull Request)\nPull Requests will be merged via rebase, as we use gitchangelog to generate\nchangelogs. As such, The commit message in your pull request should describe\nwhat is being changed, and should follow the gitchangelog commit message\nspecs (below).\n\n### Pull request commit messages should follow GitChangeLog specifications\nThese specifications can be found [here][3].\n\n\nAs an example, if I was fixing documentation, I might create the following commit text:\n\n```fix: doc: Fixed Installation Instructions to reference proper pip package.```\n\n\nThe above requirements are verified via Travis-CI and Coveralls for Python versions 2.7, 3.4, and 3.5.\n\n\n[1]: https://github.com/rtrox/mssqlcli\n[2]: https://github.com/rtrox/mssqlcli/issues\n[3]: https://github.com/vaab/gitchangelog/blob/master/gitchangelog.rc.reference\n\n1.0.2 (2016-10-25)\n------------------\n\nNew\n~~~\n\n- Add gitchangelog configuration, CONTRIBUTING.md. (#54) [Russell\n Troxel]\n\n - Adds a ``CONTRIBUTING.md`` File to provide guildelines around development and pull requests.\n - Adds a .gitchangelog.rc file to start programmatically generating ``CHANGELOG.rst`` files for PyPI releases.\n\nOther\n~~~~~\n\n- Stage Release v1.0.2. [Russell Troxel]\n\n- Resolve mssql.drivers issue (#50) with setup.py. (#51) [Russell\n Troxel]\n\n * Resolve mssql.drivers issue (#50) with setup.py.\n\n * Resolve mssql.drivers issue (#50) with setup.py.\n\n * Resolve mssql.drivers issue (#50) with setup.py.\n\n- Automate PanDoc conversion during registration. (#49) [Russell Troxel]\n\n- Update README files: usage and examples (#48) [\u0130lim U\u011fur]\n\n * Update readme files for the new usage.\n\n * Add template_query command and fix minor prior issues from manual editing.\n\n * Add example usage of template_query and templated SQL query.\n\n- Set default option to `pretty`, updated options & renamed both tests\n (#46) [the-zebulan]\n\n * Set default option to 'pretty'\n\n * Updated options and renamed both tests, #34\n\n- Implement template_query subcommand. (#45) [Russell Troxel]\n\n- Add --version flag (#33) (#38) [Dmitriy]\n\n Closes #33\n * Add --version flag (#33)\n\n * PEP8 fix\n\n- Version bump to 1.0.1b (#37) [Russell Troxel]\n\n- Version bump to 1.0.1a (#35) [Russell Troxel]\n\n- Add shield.io badges (#31) [Thomas Nys]\n\n- Stage Release 1.0.1 (#29) [Russell Troxel]\n\n- Closes #12: Allow testing via setup.py test - Calls Tox. (#28)\n [Russell Troxel]", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rtrox/mssqlcli", "keywords": "microsoft,sql,mssql", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "mssqlcli", "package_url": "https://pypi.org/project/mssqlcli/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mssqlcli/", "project_urls": { "Homepage": "https://github.com/rtrox/mssqlcli" }, "release_url": "https://pypi.org/project/mssqlcli/1.0.4/", "requires_dist": null, "requires_python": "", "summary": "Python CLI for Microsoft SQL.", "version": "1.0.4" }, "last_serial": 2829254, "releases": { "0.8": [], "0.8.1": [], "0.8.2": [], "1.0": [], "1.0.1": [], "1.0.1a0": [ { "comment_text": "", "digests": { "md5": "42480ad8fa9ea75c0ef18a3a2121c5e5", "sha256": "0028299af155c008645230ddb974504a7c2182691c03917c0c28f5f3fce77d38" }, "downloads": -1, "filename": "mssqlcli-1.0.1a0.tar.gz", "has_sig": false, "md5_digest": "42480ad8fa9ea75c0ef18a3a2121c5e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8328, "upload_time": "2016-10-24T12:31:51", "url": "https://files.pythonhosted.org/packages/75/cf/4db0d14fbb236637ab69dd2d1d5e087afe26d4a43cb09b96fa687f08d022/mssqlcli-1.0.1a0.tar.gz" } ], "1.0.1b0": [ { "comment_text": "", "digests": { "md5": "3bd7aa71b9daedaa9f4d4ca4c55201cb", "sha256": "1efde615d357b93d8e6df7fe9b41a24fd16ea612531d508fc0fc310de1b6a233" }, "downloads": -1, "filename": "mssqlcli-1.0.1b0.tar.gz", "has_sig": false, "md5_digest": "3bd7aa71b9daedaa9f4d4ca4c55201cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8324, "upload_time": "2016-10-24T13:08:47", "url": "https://files.pythonhosted.org/packages/58/d3/4c934368f14cf36fc9d254f9203db106ab8a9c9c3897d9b74e29fe226fcd/mssqlcli-1.0.1b0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "a5a5b83da646b54dd508a4e18e90c88a", "sha256": "479599da7cc21fce4bd2e1ce49c85f5a883eeea412cc85306fc5dd7c737c721b" }, "downloads": -1, "filename": "mssqlcli-1.0.2.tar.gz", "has_sig": false, "md5_digest": "a5a5b83da646b54dd508a4e18e90c88a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24841, "upload_time": "2016-10-25T23:02:53", "url": "https://files.pythonhosted.org/packages/f5/84/94f08a9f9b273ad84d79771fd4bde2d5b5e673f84dbcc98a9738847c5ad4/mssqlcli-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "45f8242ab393ab58f5f40741f5bcd846", "sha256": "032c8de3e4afdd9957fa839a5acd5a3b7470fa02bbe48acca53fa23b8230559b" }, "downloads": -1, "filename": "mssqlcli-1.0.3.tar.gz", "has_sig": false, "md5_digest": "45f8242ab393ab58f5f40741f5bcd846", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27090, "upload_time": "2017-04-24T22:22:04", "url": "https://files.pythonhosted.org/packages/89/ee/35bb7f7f4099cad7d3c7beaa6b7695194d432907a1b06ef95edfc186bfaa/mssqlcli-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "5a79dd3e550c83858a8ee7e0e9c68635", "sha256": "28cc87b1488649cfb10ef0af138f3a953472e6b1437c25c063d8e96ba184a811" }, "downloads": -1, "filename": "mssqlcli-1.0.4.tar.gz", "has_sig": false, "md5_digest": "5a79dd3e550c83858a8ee7e0e9c68635", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27129, "upload_time": "2017-04-25T15:47:16", "url": "https://files.pythonhosted.org/packages/9e/e4/57f232431d352e4712f9e1cccdec4ed2b6870fa8ff3f4f409d05bf482754/mssqlcli-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a79dd3e550c83858a8ee7e0e9c68635", "sha256": "28cc87b1488649cfb10ef0af138f3a953472e6b1437c25c063d8e96ba184a811" }, "downloads": -1, "filename": "mssqlcli-1.0.4.tar.gz", "has_sig": false, "md5_digest": "5a79dd3e550c83858a8ee7e0e9c68635", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27129, "upload_time": "2017-04-25T15:47:16", "url": "https://files.pythonhosted.org/packages/9e/e4/57f232431d352e4712f9e1cccdec4ed2b6870fa8ff3f4f409d05bf482754/mssqlcli-1.0.4.tar.gz" } ] }