{"id":21441300,"url":"https://github.com/noorzaie/aqs-typeorm","last_synced_at":"2026-04-18T01:02:57.298Z","repository":{"id":57183045,"uuid":"435149069","full_name":"noorzaie/aqs-typeorm","owner":"noorzaie","description":"build typeorm queries using query string","archived":false,"fork":false,"pushed_at":"2021-12-05T11:38:08.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-31T10:29:07.079Z","etag":null,"topics":["aqs","mysql","postgresql","query-builder","query-string","sql","typeorm"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/noorzaie.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":"2021-12-05T11:36:02.000Z","updated_at":"2021-12-05T11:40:02.000Z","dependencies_parsed_at":"2022-09-14T06:10:33.332Z","dependency_job_id":null,"html_url":"https://github.com/noorzaie/aqs-typeorm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/noorzaie/aqs-typeorm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noorzaie%2Faqs-typeorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noorzaie%2Faqs-typeorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noorzaie%2Faqs-typeorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noorzaie%2Faqs-typeorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noorzaie","download_url":"https://codeload.github.com/noorzaie/aqs-typeorm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noorzaie%2Faqs-typeorm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31952208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"ssl_error","status_checked_at":"2026-04-18T00:39:20.671Z","response_time":62,"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":["aqs","mysql","postgresql","query-builder","query-string","sql","typeorm"],"created_at":"2024-11-23T01:23:22.982Z","updated_at":"2026-04-18T01:02:57.281Z","avatar_url":"https://github.com/noorzaie.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"`aqs-typeorm` is a tool that builds [typeorm](https://typeorm.io) queries using [aqs](https://github.com/noorzaie/aqs) output.\n`aqs` is a query parser library that can parse advanced operators and also query logic, so when you use it together wit aqs-typeorm, you can create typeorm queries from query string.\n\n## Installation\n```npm\nnpm install aqs-typeorm\n```\n\n## Usage\nFirst you need to parse query string using `aqs`:\n```javascript\nimport { parse } from 'aqs';\nimport { createConnection } from 'typeorm';\nimport { aqsToTypeorm } from 'aqs-typeorm';\nimport { User } from 'models/User';\n\nconst queryString = 'id{gt}4\u0026name=joe';\nconst params = parse(queryString);\n```\n\nThen you can pass `params` to `aqs-typeorm` to build query using typeorm query builder:\n```javascript\ncreateConnection({\n    type: \"postgres\",\n    host: \"localhost\",\n    username: \"***\",\n    password: \"***\",\n    database: \"***\",\n    schema: \"public\",\n    entities: [ \"User.ts\" ]\n})\n    .then(connection =\u003e {\n        let builder = connection.getRepository(User).createQueryBuilder('user');\n        aqsToTypeorm(params, builder);\n        console.log(builder.getSql());\n        // output: SELECT * \"public\".\"user\" \"user\" WHERE \"user\".\"id\" \u003e 4 AND \"user\".\"name\" = \"joe\"\n    });\n```\n\nThere are some more examples that you can find in [exmaples](https://github.com/noorzaie/aqs-typeorm/tree/master/examples) folder.\n\n## Configurations\nYou can configure name of different field that could be passed in query string:\n\n| Option  | Description | Default value |\n| ------------- | ------------- | ------------- |\n| orderField  | Name of field to be used as order parameter  | order  |\n| orderByField  | Name of field to be used as order_by field  | orderBy  |\n| selectField  | Name of field to be used to select output fields  | select  |\n| limitField  | Name of field to be used as limit field  | limit  |\n| pageField  | Name of field to be used for pagination  | page  |\n| perPage  | Number of results to be returned  |   |\n| selectJoin  | Return joined relation in result or not  | true  |\n| joinAliases  | Alias of join operators (see typeorm docs)  |   |\n| selectAliases  | Alias of selected fields (see typeorm docs)  |   |\n\n## Note\nThis package currently supports `postgres` and `mysql` dialects of typeorm.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoorzaie%2Faqs-typeorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoorzaie%2Faqs-typeorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoorzaie%2Faqs-typeorm/lists"}