SQLAlchemy – naked sql query
An example of a bare sql query in ORM SQLAlchemy.
result = db.engine…execute(
“” ”
SELECT
array_agg (DISTINCT t.topic) as topic,
array_agg (t.user_ask)
FROM conversation_user t
GROUP BY t.topic
“” “
)
names = [[row[[1] for row in result]
print(names)
Hello! You are on my site. I’m a developer. Here I share my best practices and knowledge. (Disclaimer) Ask in the comments if you don’t understand something or write if you have something to add.