guidofaecke / jsondbquery
Generate SQL from URL json query string
dev-master
2018-06-12 15:32 UTC
Requires
- php: ^7.1
Requires (Dev)
- beberlei/assert: ~2.9
- doctrine/doctrine-orm-module: ^2.1
- phpunit/phpunit: ^6.1
- squizlabs/php_codesniffer: ^3.2
- zendframework/zend-db: ^2.9
Suggests
- doctrine/doctrine-orm-module: Needed to use JsonDbQuery with Doctrine ORM
- zendframework/zend-db: Needed to use JsonDbQuery with ZendFramework DB
This package is auto-updated.
Last update: 2024-12-12 10:22:45 UTC
README
Build simple queries with JSON via REST and RPC calls.
Planned support
- Doctrine
- Zend-Db
- raw SQL
Usage examples
(not yet finalized)
http://<your_system>/api/get_some_data?query={"field" : {"$not" : val}} http://<your_system>/api/get_some_data?query={"field" : {"$in" : [value1, value2, ...]}} http://<your_system>/api/get_some_data?query={"$or": [{"status": "BLUE"}, {"status": "RED"}]} http://<your_system>/api/get_some_data?query={"amount": {"$gt": 500}} http://<your_system>/api/get_some_data?query={"amount": {"$lte": 500}} http://<your_system>/api/get_some_data?query={"amount": {"$bt": [300, 640]}}