{"id":21189334,"url":"https://github.com/artnum/structured-json-query","last_synced_at":"2026-05-17T06:43:25.201Z","repository":{"id":230375989,"uuid":"779215458","full_name":"artnum/structured-json-query","owner":"artnum","description":"Convert a JSON object into an SQL where clause or into an LDAP filter.","archived":false,"fork":false,"pushed_at":"2024-04-08T13:42:17.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T20:46:11.445Z","etag":null,"topics":["json","ldap","query-builder","query-language","sql"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artnum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-29T09:57:13.000Z","updated_at":"2024-03-29T10:00:13.000Z","dependencies_parsed_at":"2025-03-14T20:42:43.048Z","dependency_job_id":"0c03437f-f0e8-40ae-96c3-ba7122f04518","html_url":"https://github.com/artnum/structured-json-query","commit_stats":null,"previous_names":["artnum/structured-json-query"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/artnum/structured-json-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artnum%2Fstructured-json-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artnum%2Fstructured-json-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artnum%2Fstructured-json-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artnum%2Fstructured-json-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artnum","download_url":"https://codeload.github.com/artnum/structured-json-query/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artnum%2Fstructured-json-query/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007318,"owners_count":26084280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","ldap","query-builder","query-language","sql"],"created_at":"2024-11-20T18:51:48.060Z","updated_at":"2025-10-11T13:22:20.304Z","avatar_url":"https://github.com/artnum.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Structured JSON Query\n\nConvert a JSON object into an SQL where clause or into an LDAP filter.\n\n## JSON Query Object\n\n### AND, OR\n\nNesting of fields with AND and OR is possible with the keys #and and #or. This\nfields must take an object as a value.\nNesting has no imposed limit on deepness.\n\n### Default operator and type\n\nWith no specific type and operator, it will default to equality operator and \nstring type\n\n```json\n{\n    \"#and\": {\n        \"name\": \"John Doe\",\n        \"city\": \"New York\"\n    }\n}\n\n```\n\nResult :\n\n  * SQL -\u003e   name = \"John Doe\" AND city = \"New York\"\n  * LDAP -\u003e  (\u0026(name=John Doe)(city=New York)) \n\n### Sepcific type and operator\n\nYou can specify type and/or operator :\n\n```json\n\n{\n    \"#and\": {\n        \"name\": {\"operator\": \"~\", \"type\": \"str\", \"value\": \"Jo*\"},\n        \"age\": {\"operator\": \"\u003e=\", \"type\": \"int\", \"value\": 21}\n    }\n}\n```\n\nResult: \n\n  * SQL -\u003e   name LIKE \"Jo%\" AND age \u003e= 21\n  * LDAP -\u003e  (\u0026(name=Jo*)(age\u003e=21))\n\n### Nesting example\n\n```json\n{\n    \"or\": {\n        \"name\": {\"operator\": \"~\", \"value\": \"J*\"},\n        \"#and\": {\n            \"age\": {\"operator\": \"\u003c\", \"type\": \"int\", \"value\": 65},\n            \"age\": {\"operator\": \"\u003e\", \"type\": \"int\", \"value\": 18}\n        }\n    }\n}\n```\n\nResult :\n\n  * SQL -\u003e   (name LIKE \"J*\" OR (age \u003c 65 AND age \u003e 18))\n  * LDAP -\u003e  (|(name=J*)(|(age\u003c65)(age\u003e18)))","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartnum%2Fstructured-json-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartnum%2Fstructured-json-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartnum%2Fstructured-json-query/lists"}