I'm reading through the docs pertaining to SQLAlchemy's textual SQL and custom functions, and it's not clear to me how to combine the two.
For example, let's say I have the following code:
# relevant imports
def f(username):
if len(username) < 5:
return True
else:
return False
t = text("select * from users where f(username)")
db.session.execute(t)
I know that this particular example may not requred a user-defined function, but I would appreciate a general answer that will work for any user-define function.