tortoise-orm icon indicating copy to clipboard operation
tortoise-orm copied to clipboard

json_contains NotImplementedError with SQLite - only works with PostgreSQL

Open zkanda opened this issue 8 months ago • 0 comments

Describe the bug Using field__contains on JSONField with SQLite throws NotImplementedError: must be overridden in each executor. Works fine with PostgreSQL but SQLite just crashes.

To Reproduce https://gist.github.com/zkanda/b6151db1bbe984772be037e431a14604

Expected behavior Either implement it for SQLite or give a proper error message saying "JSON contains not supported with SQLite". Right now it's just a confusing NotImplementedError.

Additional context

  • Error happens in filters.py:230 where json_contains isn't implemented for SQLite
  • Makes it impossible to write db-agnostic code with JSON fields
  • No docs mention this limitation

zkanda avatar May 31 '25 23:05 zkanda