tortoise / tortoise/tortoise-orm
json_contains NotImplementedError with SQLite - only works with PostgreSQL
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at filters.py:230 and reproduce the JSONField __contains failure using the linked gist. Determine whether SQLite support or a clear unsupported-feature error is intended, then verify that SQLite no longer exposes the confusing NotImplementedError and that PostgreSQL behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python, sqlite
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100