Skip to main content

Helper functions for comfortable working with SQLAlchemy.

Project description

In what follows python3 is an alias for python3.5 or any later version (python3.6 and so on).


Install the latest pip & setuptools packages versions

python3 -m pip install --upgrade pip setuptools


Download and install the latest stable version from PyPI repository

python3 -m pip install --upgrade hypothesis_sqlalchemy


Download and install the latest version from GitHub repository

git clone
cd hypothesis_sqlalchemy
python3 install


Assuming that POSTGRES_URI environment variable is set and corresponds to the working database instance:

>>> import os
>>> from sqlalchemy.engine.url import make_url
>>> postgres_uri = make_url(os.environ['POSTGRES_URI'])
>>> from sqlalchemy_helpers.connectable import check_connection
>>> check_connection(postgres_uri)
>>> from sqlalchemy_helpers.connectable import create_engine
>>> with create_engine(postgres_uri) as engine:
...     engine.scalar('SELECT 1')
>>> from sqlalchemy_helpers.connectable import open_connection
>>> with create_engine(postgres_uri) as engine:
...     with open_connection(engine) as connection:
...         connection.scalar('SELECT 1')

Running tests


python3 test


  • $POSTGRES_USERNAME: PostgreSQL database user name (e.g. postgres),
  • $POSTGRES_PASSWORD: PostgreSQL database user password (e.g. ilovepostgresql),
  • $POSTGRES_HOSTNAME: PostgreSQL database host (e.g. localhost),
  • $POSTGRES_PORT: PostgreSQL database port (e.g. 5432),
  • $POSTGRES_DATABASE: target PostgreSQL database name (e.g. testdb),
  • $MYSQL_USERNAME: MySQL database user name (e.g. root),
  • $MYSQL_PASSWORD: MySQL database user password (e.g. ilovemysql),
  • $MYSQL_HOSTNAME: MySQL database host (e.g. localhost),
  • $MYSQL_PORT: MySQL database port (e.g. 3306),
  • $MYSQL_DATABASE: target MySQL database name (e.g. testdb).

Inside Docker container with remote debugger

./ docker-compose up

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sqlalchemy_helpers, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size sqlalchemy_helpers-0.1.0.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page