[sqlalchemy] Re: sqlalchemy messes up names with "_1" suffix

2020-07-10 Thread 'Jonathan Vanasco' via sqlalchemy
> i have this litte flask-admin game running, now out of nowwhere sqlalchemy has begun to add strange "_1" suffixes to the column names. i know sqlalchemy does this to keep names unique, but in my case the queries are failing SQLAlchemy does do this, for those reasons, and to the columns...

Re: [sqlalchemy] Remap an SQLAlchemy instance to a different non-SQLAlchemy class

2020-07-10 Thread Mike Bayer
hey there - what you're doing is suited by an included feature of SQLAlchemy called "single table inheritance", which will return to you instances of "Mammal" or AnimalModel object based on the value of "type". see:

Re: [sqlalchemy] Encrypt/Decrypt specific column(s)

2020-07-10 Thread Mike Bayer
the AES library has been updated a bit so I updated the recipes at: https://github.com/sqlalchemy/sqlalchemy/wiki/SymmetricEncryptionClientSide regardless of what encrpytion you are using, for a WHERE clause to work, you need to ensure the encrypt() function produces the same string each time.

Re: [sqlalchemy] Encrypt/Decrypt specific column(s)

2020-07-10 Thread Mike Bayer
The recipe encrypts the value in the WHERE clause, however it seems like the usage of the libraries in the example is a bit out of date for Python 3. What Python version are you using ? On Thu, Jul 9, 2020, at 1:15 PM, Justvuur wrote: > So there is good news and bad news hehe. > Good news is

Re: [sqlalchemy] Encrypt/Decrypt specific column(s)

2020-07-10 Thread Simon King
Not in the traditional sense, no. ORDER BY is implemented by the database, and with client-side encryption, the database only ever sees encrypted strings. Simon On Fri, Jul 10, 2020 at 8:41 AM Justin Van Vuuren wrote: > > Also, regarding the client side approach, would one be able to do an

[sqlalchemy] Re: sqlalchemy messes up names with "_1" suffix

2020-07-10 Thread Ben
Not sure if this will help but are you using FlaskWTF? If you have repeating fields on a form, some of its data structures will append a _1, _2... to each instance in your response to keep them unique. So, just a guess, but perhaps your problem is related to Flask / WTForms? On Friday, July

Re: [sqlalchemy] sqlalchemy messes up names with "_1" suffix

2020-07-10 Thread Mike Bayer
On Fri, Jul 10, 2020, at 8:50 AM, Xander Cage wrote: > hi, > > i have this litte flask-admin game running, now out of nowwhere sqlalchemy > has begun to add strange "_1" suffixes to the column names. i know sqlalchemy > does this to keep names unique, but in my case the queries are failing >

[sqlalchemy] sqlalchemy messes up names with "_1" suffix

2020-07-10 Thread Xander Cage
hi, i have this litte flask-admin game running, now out of nowwhere sqlalchemy has begun to add strange "_1" suffixes to the column names. i know sqlalchemy does this to keep names unique, but in my case the queries are failing and my naming is unique. my models: ### DB models # Base model

Re: [sqlalchemy] Encrypt/Decrypt specific column(s)

2020-07-10 Thread Justin Van Vuuren
Also, regarding the client side approach, would one be able to do an order by query? On Thu, 9 Jul 2020 at 21:28, Justvuur wrote: > A, ok ye, I understand, then I prefer client side. > I just need to sort out the encryption then... I'm not too familiar with > encryption algorithms but at