SQLAlchemy: JSON_ARRAY_APPEND?

Viewed 91

I need to update a JSON type column in a MySQL database using JSON_ARRAY_APPEND. I can't just use python's .append() because this operation needs to occur on the database level to avoid race conditions.

Is this possible to do with SQLAlchemy?

1 Answers

Yes, you can use database builtin functions thanks to func:

from sqlalchemy import func

func.json_array_append(...)
Related