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

2020-07-09 Thread Mike Bayer
On Thu, Jul 9, 2020, at 4:53 AM, Justvuur wrote: > Hi Mike, > > This is awesome! Yes, I like the client side approach, especially the "Use > TypeDecorator" method. > Is there a specific version of SQLAlchemy I need? TypeDecorator is pretty universal so it should work for any modern version in

Re: [sqlalchemy] postgresql geometry types

2020-07-09 Thread Mike Bayer
Hi - I think you want to be using geoalchemy2: https://geoalchemy-2.readthedocs.io/en/latest/ On Wed, Jul 8, 2020, at 3:37 PM, Роберт Шотланд wrote: > We are beginning to use the PostgreSQL (12) geometric types (initially the > 'point' datatype) in our SA model, and was disappointed to find

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

2020-07-09 Thread Justvuur
So there is good news and bad news hehe. Good news is if I query all the other columns (no encrypted) columns it works. All results are returned correctly and decrypted. Bad news, if I query the encrypted column, nothing is "found". This is my model: class StudentFormField(db.Model):

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

2020-07-09 Thread 'Jonathan Vanasco' via sqlalchemy
On Thursday, July 9, 2020 at 2:12:36 PM UTC-4, Justvuur wrote: > > I've done some more digging... It seems when I did the search for > "secrets", the text is encrypted and compared to the value in the columns, > That is how client-side encryption works. If you want to search for "secrets",

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

2020-07-09 Thread Justvuur
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 the moment its using a text key from a config file and the mode is CBC which I guess is what is generating a different value each time

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

2020-07-09 Thread Justvuur
I've done some more digging... It seems when I did the search for "secrets", the text is encrypted and compared to the value in the columns, see below: SELECT student_form_fields.field_value AS student_form_fields_field_value, student_form_fields.student_id AS

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

2020-07-09 Thread Raghav
Hello everyone, hope you're all doing well. I have a table which has a type column. Based on that value I need to instantiate a new class. I'm looking for a way to operate my SQLAlchemy object through this new class. Here's my model class: ``` class AnimalModel(Base): __tablename__ =