Metadata-Version: 2.1
Name: sql-helper
Version: 0.0.16
Summary: Helper funcs and tools for working with SQL in mysql, postgresql, and more
Home-page: https://github.com/kenjyco/sql-helper
Download-URL: https://github.com/kenjyco/sql-helper/tarball/v0.0.16
Author: Ken
Author-email: kenjyco@gmail.com
License: MIT
Keywords: sql,mysql,postgresql,sqlite,helper
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Libraries
Classifier: Intended Audience :: Developers
License-File: LICENSE.txt
Requires-Dist: PyMySQL (>=0.9.3)
Requires-Dist: SQLAlchemy (<1.5,>=1.3)
Requires-Dist: bg-helper
Requires-Dist: click (>=6.0)
Requires-Dist: cryptography
Requires-Dist: psycopg2-binary (<3,>=2.8)
Requires-Dist: settings-helper

About
-----

This is meant to be a simple way to explore a postgresql/mysql/sqlite
database and get data out (super light wrapper to SQLAlchemy).

Connect with DB url in the following formats:

-  ``postgresql://someuser:somepassword@somehost[:someport]/somedatabase``
-  ``mysql://someuser:somepassword@somehost[:someport]/somedatabase``
-  ``sqlite:///somedb.db``

..

   Note: This package uses ``pymysql`` driver for connecting to mysql.
   Urls that start with ``mysql://`` will automatically be changed to
   use ``mysql+pymysql://``.

Install
-------

   Ensure the ``pg_config`` executable is on the system

::

   $ sudo apt-get install -y libpq-dev

   or

   $ brew install postgresql

Then install sql-helper

::

   $ pip3 install sql-helper

Usage
-----

::

   In [1]: from sql_helper import SQL

   In [2]: sql = SQL('postgresql://someuser:somepassword@somehost/somedatabase')

   In [3]: table_names = sql.get_tables()

   In [4]: results = sql.execute('SELECT ...')

Extra
-----

`Redshift <https://aws.amazon.com/redshift/>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Install ``sqlalchemy-redshift`` wherever you installed ``sql-helper``

::

   $ venv/bin/pip3 install sqlalchemy-redshift

Connect with DB url in the following format:

-  ``redshift+psycopg2://someuser:somepassword@somehost/somedatabase``


