> 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/0dfba5fd-bdfd-4eee-9877-7650c0d8ee22%40googlegroups.com.