I want to call SUSER_SNAME
using SQLAlchemy’s ORM. I can call the user()
function like this:
res = connection.execute(sqlalchemy.sql.functions.user())
But If I replace user()
with suser_sname()
I get this:
AttributeError: module ‘sqlalchemy.sql.functions’ has no attribute
‘suser_sname’
I know that I can just execute sqlalchemy.text("SELECT SUSER_SNAME()")
but I would like to add a custom function to achieve this. Is this possible?
1