Hello all!

Probably this is a simple question, but i don't understand the right way...

Suppose I have the following table:

class User(Base):

    __tablename__ = 'user'

    id = Column(Integer, primary_key=True)

    text_value = Column("text_value", String(40), nullable=False)

    date_value = Column(«date_value", Date, nullable=False)


My task is to *store data* in this table *encrypted*, but i can’t 
understand how to properly write encrypted type class (based on 
TypeDecorator) for *non-string* columns (for example dates). Can anyone 
give me a little example for date objects like this one. (
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SymmetricEncryption). Or 
with this sql-level bind/result 
processing<http://docs.sqlalchemy.org/en/rel_0_9/core/types.html#applying-sql-level-bind-result-processing>
.

As I think I should "wrap" all my columns in EncryptedString and save all 
types as strings (convert and encrypt in process_bind_param) in DB and then 
decrypt them in process_result_value. Am i right? And the other question, 
how then provide a *quick lookup* in table for example *for dates*?

If it’s the wrong way prompt me the right way. :)


*Thanks*!

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to