Is there a way to execute json_extract, json_each and json_tree queries using SQLAlchemy ORM?

136 views
Skip to first unread message

tshrs...@gmail.com

unread,
Aug 23, 2019, 1:42:26 PM8/23/19
to python-sqlite
I am facing below issue while creating a ORM query on json1 ext enbled sqlite3 database:

sqlalchemy.exc.OperationalError

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such function: JSON_EXTRACT [SQL: SELECT event_history_table.timestamp AS event_history_table_timestamp, event_history_table.event AS event_history_table_event FROM event_history_table WHERE JSON_QUOTE(JSON_EXTRACT(CAST(event_history_table.event AS JSON), ?)) LIKE ? ORDER BY event_history_table.timestamp DESC LIMIT ? OFFSET ?] [parameters: ('$."about"', '%connection%', 3, 0)]


I wanted to use sqlalchemy as my ORM tool core layer is genearating above query but the dbapi pysqlite is giving me no such function: JSON_EXTRACT.


Reply all
Reply to author
Forward
0 new messages