Re: [sqlalchemy] AWS RDS generate-db-auth-token and Redshift get-cluster-credentials

2020-05-22 Thread Mike Bayer
engine strategies are gone in 1.4 so you're going to want to make use of event 
and plugin hooks such as:

https://docs.sqlalchemy.org/en/13/core/connections.html?highlight=plugin#sqlalchemy.engine.CreateEnginePlugin

https://docs.sqlalchemy.org/en/13/core/events.html?highlight=do_connect#sqlalchemy.events.DialectEvents.do_connect

these two hooks are both available in all 1.x versions and if they are not 
sufficient for what you need, if you can let me know that would be great, 
strategies are already removed from master as these were not really the 
"public" hook.

On Fri, May 22, 2020, at 4:31 PM, Elmer de Looff wrote:
> For reference, we've used this engine strategy for a while, which seems to 
> get the job done. We're strictly on Postgres so the code could do with some 
> alterations to make it compatible with multiple backends, that's left as an 
> exercise to the reader :-)
> 
> The main work is done in _rds_engine_creator() which gets the necessary 
> (short-lived) credentials for the connection just before it's actually 
> created. There's a couple of ways to do this, this is simply one that got us 
> a nice hands-off result where all we needed was to provide a different engine 
> strategy in the config. Adjust for your particular use case.
> 
> # Register this engine strategy somewhere in your imported models
> class RdsEngineStrategy(PlainEngineStrategy):
> name = 'rds'
> 
> def create(self, name_or_url, **kwargs):
> """Adds an RDS-specific 'creator' for the engine connection."""
> engine_url = make_url(name_or_url)
> kwargs['creator'] = self._rds_engine_creator(engine_url)
> return super().create(engine_url, **kwargs)
> 
> def _rds_engine_creator(self, engine_url):
> instance_id, region = engine_url.host.split('.')
> connector = engine_url.get_dialect().dbapi().connect
> rds = boto3.client('rds', region_name=region)
> if self._rds_first_instance_by_name(rds, instance_id) is None:
> raise ValueError('No RDS instances for the given instance ID')
> 
> def engine_func():
> instance = self._rds_first_instance_by_name(rds, instance_id)
> password = rds.generate_db_auth_token(
> DBHostname=instance['Endpoint']['Address'],
> DBUsername=engine_url.username,
> Port=instance['Endpoint']['Port'])
> return connector(
> host=instance['Endpoint']['Address'],
> port=instance['Endpoint']['Port'],
> database=engine_url.database,
> user=engine_url.username,
> password=password,
> sslmode='require')
> return engine_func
> 
> def _rds_first_instance_by_name(self, client, name):
> response = client.describe_db_instances(DBInstanceIdentifier=name)
> return next(iter(response['DBInstances']), None)
> 
> 
> # Make sure to actually register it
> RdsEngineStrategy()
> 
> # Caller code
> engine = 
> sqlalchemy.create_engine("postgres://user@instance-name.region/dbname", 
> strategy="rds")
> 
> 
> On Fri, May 22, 2020 at 9:54 PM Mike Bayer  wrote:
>> __
>> You can modify how the engine makes connections using the do_connect event 
>> hook:
>> 
>> https://docs.sqlalchemy.org/en/13/core/events.html?highlight=do_connect#sqlalchemy.events.DialectEvents.do_connect
>> 
>> each time the engine/ pool go to make a new connection, you can affect all 
>> the arguments here, or return an actual DBAPI connection.
>> 
>> 
>> 
>> 
>> On Fri, May 22, 2020, at 1:39 PM, Ryan Kelly wrote:
>>> Hi,
>>> 
>>> I am looking to use credentials provided by the above functionality from 
>>> AWS. Basically, using either of these methods, you can obtain temporary 
>>> credentials (for RDS, just password, and Redshift both username and 
>>> password) that can be used to access the database. However, for long 
>>> running processes, connection failures and subsequent reconnections as well 
>>> as new connections initiated by the connection pool (or even just waiting a 
>>> long time between generating the credentials and making your first 
>>> connection) the credentials configured on a URL as passed to create_engine 
>>> will eventually begin to fail.
>>> 
>>> At first I thought I'd simply subclass URL and make username/password 
>>> properties that could be refreshed as needed, but digging into 
>>> create_connection it seems like those properties are read out of the URL 
>>> object and into cargs/cwargs and provided to pool as such.
>>> 
>>> I took then a roundabout approach or creating a proxy object that is 
>>> capable of refreshing the value and using this object as the 
>>> username/password, which only works because psycogp2 is helpfully calling 
>>> str() on them as it constructs the connstring/dsn. Which... I mean, is an 
>>> interesting, but also unsustainable, solution.
>>> 
>>> What I am asking, I suppose, is 1) am I missing something obvious that 
>>> would make this achievable? and 2) if not, what kind of best-approach pull 
>>> request could I produce that could make this happen?
>>> 
>>> Thanks,
>>> -Ryan
>>> 

>>> --
>>> SQLAlchemy - 
>>> The Python SQL Toolkit and Object Relational Mapper
>>> 
>>> http://www.sqlalchemy.org/
>>> 
>>> 

Re: [sqlalchemy] AWS RDS generate-db-auth-token and Redshift get-cluster-credentials

2020-05-22 Thread Elmer de Looff
For reference, we've used this engine strategy for a while, which seems to
get the job done. We're strictly on Postgres so the code could do with some
alterations to make it compatible with multiple backends, that's left as an
exercise to the reader :-)

The main work is done in _rds_engine_creator() which gets the
necessary (short-lived) credentials for the connection just before it's
actually created. There's a couple of ways to do this, this is simply one
that got us a nice hands-off result where all we needed was to provide a
different engine strategy in the config. Adjust for your particular use
case.

# Register this engine strategy somewhere in your imported models
class RdsEngineStrategy(PlainEngineStrategy):
name = 'rds'

def create(self, name_or_url, **kwargs):
"""Adds an RDS-specific 'creator' for the engine connection."""
engine_url = make_url(name_or_url)
kwargs['creator'] = self._rds_engine_creator(engine_url)
return super().create(engine_url, **kwargs)

def _rds_engine_creator(self, engine_url):
instance_id, region = engine_url.host.split('.')
connector = engine_url.get_dialect().dbapi().connect
rds = boto3.client('rds', region_name=region)
if self._rds_first_instance_by_name(rds, instance_id) is None:
raise ValueError('No RDS instances for the given instance ID')

def engine_func():
instance = self._rds_first_instance_by_name(rds, instance_id)
password = rds.generate_db_auth_token(
DBHostname=instance['Endpoint']['Address'],
DBUsername=engine_url.username,
Port=instance['Endpoint']['Port'])
return connector(
host=instance['Endpoint']['Address'],
port=instance['Endpoint']['Port'],
database=engine_url.database,
user=engine_url.username,
password=password,
sslmode='require')
return engine_func

def _rds_first_instance_by_name(self, client, name):
response = client.describe_db_instances(DBInstanceIdentifier=name)
return next(iter(response['DBInstances']), None)


# Make sure to actually register it
RdsEngineStrategy()

# Caller code
engine = sqlalchemy.create_engine("postgres://user@instance-name.region
/dbname", strategy="rds")


On Fri, May 22, 2020 at 9:54 PM Mike Bayer  wrote:

> You can modify how the engine makes connections using the do_connect event
> hook:
>
>
> https://docs.sqlalchemy.org/en/13/core/events.html?highlight=do_connect#sqlalchemy.events.DialectEvents.do_connect
>
> each time the engine/ pool go to make a new connection, you can affect all
> the arguments here, or return an actual DBAPI connection.
>
>
>
>
> On Fri, May 22, 2020, at 1:39 PM, Ryan Kelly wrote:
>
> Hi,
>
> I am looking to use credentials provided by the above functionality from
> AWS. Basically, using either of these methods, you can obtain temporary
> credentials (for RDS, just password, and Redshift both username and
> password) that can be used to access the database. However, for long
> running processes, connection failures and subsequent reconnections as well
> as new connections initiated by the connection pool (or even just waiting a
> long time between generating the credentials and making your first
> connection) the credentials configured on a URL as passed to create_engine
> will eventually begin to fail.
>
> At first I thought I'd simply subclass URL and make username/password
> properties that could be refreshed as needed, but digging into
> create_connection it seems like those properties are read out of the URL
> object and into cargs/cwargs and provided to pool as such.
>
> I took then a roundabout approach or creating a proxy object that is
> capable of refreshing the value and using this object as the
> username/password, which only works because psycogp2 is helpfully calling
> str() on them as it constructs the connstring/dsn. Which... I mean, is an
> interesting, but also unsustainable, solution.
>
> What I am asking, I suppose, is 1) am I missing something obvious that
> would make this achievable? and 2) if not, what kind of best-approach pull
> request could I produce that could make this happen?
>
> Thanks,
> -Ryan
>
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sqlalchemy/CAHUie25g0G5OPuyDHaNn8oWkTzizwQxGY0tnkaJvOewLMQR4DQ%40mail.gmail.com
> 
> .
>
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, 

Re: [sqlalchemy] AWS RDS generate-db-auth-token and Redshift get-cluster-credentials

2020-05-22 Thread Mike Bayer
You can modify how the engine makes connections using the do_connect event hook:

https://docs.sqlalchemy.org/en/13/core/events.html?highlight=do_connect#sqlalchemy.events.DialectEvents.do_connect

each time the engine/ pool go to make a new connection, you can affect all the 
arguments here, or return an actual DBAPI connection.




On Fri, May 22, 2020, at 1:39 PM, Ryan Kelly wrote:
> Hi,
> 
> I am looking to use credentials provided by the above functionality from AWS. 
> Basically, using either of these methods, you can obtain temporary 
> credentials (for RDS, just password, and Redshift both username and password) 
> that can be used to access the database. However, for long running processes, 
> connection failures and subsequent reconnections as well as new connections 
> initiated by the connection pool (or even just waiting a long time between 
> generating the credentials and making your first connection) the credentials 
> configured on a URL as passed to create_engine will eventually begin to fail.
> 
> At first I thought I'd simply subclass URL and make username/password 
> properties that could be refreshed as needed, but digging into 
> create_connection it seems like those properties are read out of the URL 
> object and into cargs/cwargs and provided to pool as such.
> 
> I took then a roundabout approach or creating a proxy object that is capable 
> of refreshing the value and using this object as the username/password, which 
> only works because psycogp2 is helpfully calling str() on them as it 
> constructs the connstring/dsn. Which... I mean, is an interesting, but also 
> unsustainable, solution.
> 
> What I am asking, I suppose, is 1) am I missing something obvious that would 
> make this achievable? and 2) if not, what kind of best-approach pull request 
> could I produce that could make this happen?
> 
> Thanks,
> -Ryan
> 

> --
>  SQLAlchemy - 
>  The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
>  To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
>  --- 
>  You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
>  To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
>  To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/CAHUie25g0G5OPuyDHaNn8oWkTzizwQxGY0tnkaJvOewLMQR4DQ%40mail.gmail.com
>  
> .

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/d1bed41d-9fa2-4761-a963-c87720cf25b2%40www.fastmail.com.


[sqlalchemy] AWS RDS generate-db-auth-token and Redshift get-cluster-credentials

2020-05-22 Thread Ryan Kelly
Hi,

I am looking to use credentials provided by the above functionality from
AWS. Basically, using either of these methods, you can obtain temporary
credentials (for RDS, just password, and Redshift both username and
password) that can be used to access the database. However, for long
running processes, connection failures and subsequent reconnections as well
as new connections initiated by the connection pool (or even just waiting a
long time between generating the credentials and making your first
connection) the credentials configured on a URL as passed to create_engine
will eventually begin to fail.

At first I thought I'd simply subclass URL and make username/password
properties that could be refreshed as needed, but digging into
create_connection it seems like those properties are read out of the URL
object and into cargs/cwargs and provided to pool as such.

I took then a roundabout approach or creating a proxy object that is
capable of refreshing the value and using this object as the
username/password, which only works because psycogp2 is helpfully calling
str() on them as it constructs the connstring/dsn. Which... I mean, is an
interesting, but also unsustainable, solution.

What I am asking, I suppose, is 1) am I missing something obvious that
would make this achievable? and 2) if not, what kind of best-approach pull
request could I produce that could make this happen?

Thanks,
-Ryan

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/CAHUie25g0G5OPuyDHaNn8oWkTzizwQxGY0tnkaJvOewLMQR4DQ%40mail.gmail.com.


[sqlalchemy] Re: ImportError: No module named 'cx_Oracle' - Python3.6

2020-05-22 Thread Thirsty ForKnowledge
Hi Jonathan,

Thanks for your reply. 

I activated the venv and did an import of cx_Oracle. I had no issues:

(venv) -bash-4.2$ man tree
No manual entry for tree
(venv) -bash-4.2$ python3.6
Python 3.6.8 (default, Sep 26 2019, 11:57:09)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>>


On Friday, May 22, 2020 at 12:46:47 PM UTC-4, Jonathan Vanasco wrote:
>
>
>
> On Thursday, May 21, 2020 at 5:53:57 PM UTC-4, Thirsty ForKnowledge wrote:
>>
>> Hi,
>>
>> I am having an issue where a flask application is crashing with a 500 
>> Error. I upgraded from python 3.5 to 3.6 on linux:
>>
>
>  
> When you upgrade Python, you need to (re)install all of the packages.   
>
> Most likely, cx_Oracle was probably not listed as a dependency in your 
> application, so it didn't install.
>
> You can test this by opening a new Python interpreter for this virtual env 
> and typing "import cx_Oracle". if it errors out, it is not installed.
>
> Installing cx_Oracle into your 3.6 virtual environment should fix this.
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/b00418bd-0c30-4f70-ace2-367a1bfa7737%40googlegroups.com.


Re: [sqlalchemy] Pyodbc creator function ignored in create_engine (mssql)

2020-05-22 Thread Mike Bayer
that's only a warning, it's not a failure.

We will look into the warning message, however if you e.connect(), it works 
fine.



On Fri, May 22, 2020, at 6:29 AM, Peter Lai wrote:
> example:
> 
> import pyodbc
> 
> from sqlalchemy import create_engine
> 
> def creator():
>  config = {
> 'driver': 'ODBC Driver 13 for SQL Server',
> 'host': 'localhost',
> 'port': 1433,
> 'user': 'me',
> 'pw': 'mypw',
> 'dbname': 'mydb'
> }
> 
> return pyodbc.connect(
> "DRIVER={{{driver}}};SERVER={host},{port};DATABASE={dbname};UID={user};PWD={pw}".format(
>  driver=config['driver'],
>  host=config['host'],
>  port=config.get('port',1433),
>  dbname=config['dbname'],
>  user=config['user'],
>  pw=config['pw']
> )
> )
> 
> # works
> odbc_conn = creator()
> 
> # fails
> e = create_engine('mssql://', creator=creator)
> 
> 
> 
> /usr/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py:79: 
> SAWarning: No driver name specified; this is expected by PyODBC when using 
> DSN-less connections
>  "No driver name specified; "
> 
> 
> This is on SqlAlchemy 1.3.17
> 
> 
> 

> --
>  SQLAlchemy - 
>  The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
>  To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
>  --- 
>  You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
>  To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
>  To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/d3691dac-431b-4ed1-8670-59b8b959f81f%40googlegroups.com
>  
> .

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/2b0c0bc4-86c2-4085-91ef-4eccc3e644dd%40www.fastmail.com.


[sqlalchemy] Re: custom encryption for db columns/fields

2020-05-22 Thread Jonathan Vanasco
That would be purely PostgreSQL. You can look on StackOverflow for answers. 
Newer versions of postgresql also have a crypto library that can be 
compiled into the server, which may help. 
https://www.postgresql.org/docs/current/pgcrypto.html 

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/3d2b09be-0e7c-4e11-bbe9-baee61f354ea%40googlegroups.com.


[sqlalchemy] Re: ImportError: No module named 'cx_Oracle' - Python3.6

2020-05-22 Thread Jonathan Vanasco


On Thursday, May 21, 2020 at 5:53:57 PM UTC-4, Thirsty ForKnowledge wrote:
>
> Hi,
>
> I am having an issue where a flask application is crashing with a 500 
> Error. I upgraded from python 3.5 to 3.6 on linux:
>

 
When you upgrade Python, you need to (re)install all of the packages.   

Most likely, cx_Oracle was probably not listed as a dependency in your 
application, so it didn't install.

You can test this by opening a new Python interpreter for this virtual env 
and typing "import cx_Oracle". if it errors out, it is not installed.

Installing cx_Oracle into your 3.6 virtual environment should fix this.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/f24cc61a-80fc-4386-807a-2412ce25997b%40googlegroups.com.


[sqlalchemy] Pyodbc creator function ignored in create_engine (mssql)

2020-05-22 Thread Peter Lai
example:

import pyodbc

from sqlalchemy import create_engine

def creator():
config = {
'driver': 'ODBC Driver 13 for SQL Server',
'host': 'localhost',
'port': 1433,
'user': 'me',
'pw': 'mypw',
'dbname': 'mydb'
}

return pyodbc.connect(

"DRIVER={{{driver}}};SERVER={host},{port};DATABASE={dbname};UID={user};PWD={pw}"
.format(
driver=config['driver'],
host=config['host'],
port=config.get('port',1433),
dbname=config['dbname'],
user=config['user'],
pw=config['pw']
)
)

# works
odbc_conn = creator()

# fails
e = create_engine('mssql://', creator=creator)




/usr/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py:79: 
SAWarning: No driver name specified; this is expected by PyODBC when using 
DSN-less connections
  "No driver name specified; "


This is on SqlAlchemy 1.3.17


-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/d3691dac-431b-4ed1-8670-59b8b959f81f%40googlegroups.com.


[sqlalchemy] Re: custom encryption for db columns/fields

2020-05-22 Thread Justvuur
Regarding the extension of PostgreSQL, do you have an example for that?

On Tuesday, 19 May 2020 22:13:28 UTC+2, Jonathan Vanasco wrote:
>
>
> On Tuesday, 19 May 2020 19:24:48 UTC+2, Justvuur wrote:
>>>
>>> Is it possible to create a custom encryption/decryption algorithm that 
>>> can be used with sqlalchemy querying/filtering?
>>> When querying and filtering, I would like the field to automatically 
>>> decrypt using the custom algorithm.
>>>
>>
> You can create a SqlAlchemy CustomType that will encrypt/decrypt values to 
> the database.(https://docs.sqlalchemy.org/en/13/core/custom_types.html
> )
>
> There is an example of this when dealing with JSON:
>
>
> https://docs.sqlalchemy.org/en/13/core/custom_types.html#marshal-json-strings
>
>
> In order to query/filter the encrypted values, you will have to extend 
> PostgreSQL to perform the encryption, decryption, and querying of that data.
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/095bef00-4a95-40bd-88e1-a7591394ce4f%40googlegroups.com.