diff --git a/platypush/plugins/entities/__init__.py b/platypush/plugins/entities/__init__.py index 443cf51ab..74caf3cd5 100644 --- a/platypush/plugins/entities/__init__.py +++ b/platypush/plugins/entities/__init__.py @@ -3,7 +3,7 @@ from threading import Thread from time import time from typing import Optional, Any, Collection, Mapping -from sqlalchemy import or_ +from sqlalchemy import or_, text from sqlalchemy.orm import make_transient, Session from platypush.config import Config @@ -198,7 +198,7 @@ class EntitiesPlugin(Plugin): if str(session.connection().engine.url).startswith('sqlite://'): # SQLite requires foreign_keys to be explicitly enabled # in order to proper manage cascade deletions - session.execute('PRAGMA foreign_keys = ON') + session.execute(text('PRAGMA foreign_keys = ON')) entities: Collection[Entity] = ( session.query(Entity).filter(Entity.id.in_(entities)).all()