class A(Base):
    __tablename__ = 'a'
id = Column(Integer, primary_key=True)
data = Column(String)
e = create_engine('sqlite://', echo=True)
Base.metadata.create_all(e)
s = Session(e)
a1 = A()
a1.data = func.lower('SomeData')
s.add(a1)
s.commit()
assert a1.data == 'somedata'
mysql Compress() с помощью sqlalchemy