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#sqlalchem

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

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 re

[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 proc

[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", "

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':

[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 Re

[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 li

[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.connec

[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