loopbackio / loopbackio/loopback-connector-sqlite3
REQ: JSON query using the extract (->) operator
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Bug or feature request
- Bug
- Feature request
Description of feature (or steps to reproduce if bug)
SQLite3 3.38 of Feb 2022 has support for json extract -> not unlike Postgres and MySQL. This connector should be updated to use that if possible.
- SQLite documentation: https://www.sqlite.org/json1.html#jptr
- loopback-connector-postgresql commit: https://github.com/loopbackio/loopback-connector-postgresql/commit/d9121644abe667a2b7d7244068d99b81b593effe
No data type change is needed -- it's still TEXT.
Expected result
I hope the final interface is the same as the Postgres connector. The PG example is:
Customer.find({
where: {
'address.state': 'California'
},
order: 'address.city'
})
Additional information (Node.js version, LoopBack version, etc)
Eh, doesn't really matter here. No code for this stuff present is no code for this stuff present.
It's also not like people use loopback with sqlite3 for super serious business things, so don't put the priority too high. It's just nice to make it capable of this JSON stuff so people can experiment on a minimal setup.
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 with the SQLite JSON1 documentation and the linked loopback-connector-postgresql commit. Trace how this connector handles nested JSON paths for the requested Customer where and order example, then verify that JSON extraction works while values remain TEXT.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, sqlite
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100