{"id":37194863,"url":"https://github.com/ncodes/jsq","last_synced_at":"2026-01-14T22:39:22.920Z","repository":{"id":57518439,"uuid":"92260373","full_name":"ncodes/jsq","owner":"ncodes","description":"A mongoDB query parser for SQL databases","archived":false,"fork":false,"pushed_at":"2017-05-27T12:24:15.000Z","size":1133,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T12:25:18.632Z","etag":null,"topics":["go","mongo","sql"],"latest_commit_sha":null,"homepage":"https://github.com/ncodes/jsq","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ncodes.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-24T06:57:58.000Z","updated_at":"2024-08-16T11:37:48.000Z","dependencies_parsed_at":"2022-09-26T21:20:16.864Z","dependency_job_id":null,"html_url":"https://github.com/ncodes/jsq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ncodes/jsq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncodes%2Fjsq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncodes%2Fjsq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncodes%2Fjsq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncodes%2Fjsq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncodes","download_url":"https://codeload.github.com/ncodes/jsq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncodes%2Fjsq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","mongo","sql"],"created_at":"2026-01-14T22:39:22.279Z","updated_at":"2026-01-14T22:39:22.913Z","avatar_url":"https://github.com/ncodes.png","language":"Go","readme":"## JSQ - A mongoDB query parser for SQL databases\n\nJSQ allows the use of similar mongoDB query expressions to find records in traditional SQL databases like Postgres, MySQL etc. \n\n### Installation\n```\ngo get github.com/ncodes/jsq\n```\n### Example\n\n```go\n\njsq, err := NewJSQ([]string{\n    \"valid_field_1\",\n    \"name\",\n    \"age\",\n})\n\n// Parse a query\nerr := jsq.Parse(`{\n    \"name\": { \n        \"$eq\": \"ben\" \n    }\n}`)\nif err != nil {\n    log.Fatalf(\"failed to parse: %s\", err)\n}\n\n// Get SQL \nsql, args, err := jsq.ToSQL()\n```\n\n#### Supported Compare Operators\n- $eq  - Equal\n- $gt  - Greater Than\n- $gte - Greater Than or Equal\n- $lt  - Less Than\n- $lte - Less Than or Equal\n- $ne  - Not Equal\n- $in  - In array\n- $nin - Not In array\n- $not - Not (negate)\n- $sw  - Starts with\n- $ew  - End with\n- $ct  - Contains\n\n### Logical Operators\n- $and - Find records matching every expression in an array \n- $or  - Find records matching at least an expression in an array\n- $nor - Find records that fail to match all expressions in an array\n\n### Links\n\n- See full operator usage and examples on the [mongoDB website](https://docs.mongodb.com/manual/reference/operator/query/)\n- [Go Doc](https://godoc.org/github.com/ncodes/jsq)\n\n### Todo:\n- More query operators\n- Support joins and aggregate functions\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncodes%2Fjsq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncodes%2Fjsq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncodes%2Fjsq/lists"}