{"id":18972105,"url":"https://github.com/jpmonette/q","last_synced_at":"2026-01-26T21:50:15.981Z","repository":{"id":66055016,"uuid":"86690398","full_name":"jpmonette/q","owner":"jpmonette","description":"A Dynamic SOQL Query Builder for the Force.com Platform ☁️","archived":false,"fork":false,"pushed_at":"2020-05-07T19:20:28.000Z","size":17890,"stargazers_count":49,"open_issues_count":12,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-02T11:59:22.444Z","etag":null,"topics":["apex","salesforce","sfdx","soql","sosl"],"latest_commit_sha":null,"homepage":"","language":"Apex","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/jpmonette.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2017-03-30T10:31:05.000Z","updated_at":"2024-02-22T21:16:55.000Z","dependencies_parsed_at":"2023-04-20T12:18:55.538Z","dependency_job_id":null,"html_url":"https://github.com/jpmonette/q","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jpmonette/q","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpmonette%2Fq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpmonette%2Fq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpmonette%2Fq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpmonette%2Fq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpmonette","download_url":"https://codeload.github.com/jpmonette/q/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpmonette%2Fq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28789097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"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":["apex","salesforce","sfdx","soql","sosl"],"created_at":"2024-11-08T15:06:52.869Z","updated_at":"2026-01-26T21:50:15.965Z","avatar_url":"https://github.com/jpmonette.png","language":"Apex","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Q\n\nA Dynamic [SOQL Query](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_sosl_intro.htm) Builder for the [Force.com Platform](https://developer.salesforce.com/docs/atlas.en-us.fundamentals.meta/fundamentals/adg_preface.htm)\n\n[![Build Status](https://travis-ci.org/jpmonette/q.svg?branch=master)](https://travis-ci.org/jpmonette/q)\n[![Coverage Status](https://coveralls.io/repos/github/jpmonette/q/badge.svg?branch=master)](https://coveralls.io/github/jpmonette/q?branch=master)\n\n## Installation\n\nDeploy the Apex classes from the `./force-app/main/default/classes/` repository into your Salesforce project.\n\n## Usage\n\n```java\nQ query = new Q(Account.SObjectType)\n    .selectFields(SObjectType.Account.fieldSets.Example)\n    .addSubquery(new Q('Contacts'))\n    .add(Q.condition('Name').isLike('%Acme%'))\n    .add(Q.condition('BillingCountry').isNotNull())\n    .addLimit(5);\n\nSystem.debug(query.build());\n// SELECT CreatedById, Description, Owner.Email, (SELECT Id FROM Contacts) FROM Account WHERE Name LIKE '%Acme%' AND BillingCountry != null LIMIT 5\n```\n\nWhile chaining methods is a convenient way to initialise your query, you also have the ability to manually build complex queries depending on specific conditions.\n\n```java\nQ query = new Q(Contact.SObjectType).addLimit(5);\n\nif (String.isNotBlank(firstName)) {\n  query.add(Q.condition('FirstName').equalsTo(firstName))\n}\n\nif (String.isNotBlank(lastName)) {\n  query.add(Q.condition('LastName').equalsTo(lastName))\n}\n\nSystem.debug(query.build());\n// SELECT Id FROM Contact WHERE FirstName = 'Céline' AND LastName = 'Dion' LIMIT 5\n```\n\n## Roadmap\n\nThis library is being initially developed for one of my internal project,\nso API methods will likely be implemented in the order that they are\nneeded by my project. Eventually, I would like to cover the entire\nSOQL and SOSL query language, so contributions are of course\n[always welcome][contributing]. Adding new methods is relatively\nstraightforward, so feel free to join the fun!\n\n[contributing]: CONTRIBUTING.md\n\n## License\n\nThis library is distributed under the MIT license found in the [LICENSE](./LICENSE)\nfile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpmonette%2Fq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpmonette%2Fq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpmonette%2Fq/lists"}