{"id":18609824,"url":"https://github.com/unlight/odata-query-sql","last_synced_at":"2025-10-24T07:29:53.580Z","repository":{"id":138161136,"uuid":"64552929","full_name":"unlight/odata-query-sql","owner":"unlight","description":"Converts odata query to sql query.","archived":false,"fork":false,"pushed_at":"2017-04-02T16:29:14.000Z","size":11,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T01:25:44.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/unlight.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-30T16:17:39.000Z","updated_at":"2022-03-04T15:54:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"c92a8c8a-ce36-4e21-860b-185a9bec3a80","html_url":"https://github.com/unlight/odata-query-sql","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlight%2Fodata-query-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlight%2Fodata-query-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlight%2Fodata-query-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlight%2Fodata-query-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unlight","download_url":"https://codeload.github.com/unlight/odata-query-sql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239400596,"owners_count":19632049,"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","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":[],"created_at":"2024-11-07T03:07:22.362Z","updated_at":"2025-10-24T07:29:48.544Z","avatar_url":"https://github.com/unlight.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"odata-query-sql\n===============\nConverts odata query to sql query.\n\nINSTALL\n-------\n```js\nnpm i -S odata-query-sql\n```\n\nUSAGE\n-----\n```js\nvar odataQuerySql = require(\"odata-query-sql\");\nvar result = odataQuerySql(oquery, options);\n```\n\nAPI\n---\n* `oquery` odata query object ($select, $filter, etc.)\n* `options.dialect` type of sql driver (mysql, sqlite)\n* `options.resource` requested resource name (table) \n* `options.defaultLimit` limit should be set (min = 1, max = 500, default = 50)\n\nEXAMPLES\n--------\n```js\nvar odataQuerySql = require(\"odata-query-sql\");\nvar oquery = { $count: true, $filter: \"name eq 'Ivan'\", };\nvar options = { resource: \"user\", dialect: \"mysql\" });\nvar result = odataQuerySql(oquery, options);\n// result.count: \"select count(*) from user where name = 'Ivan'\"\n// result.value: \"select * from user where name = 'Ivan' limit 50\"\n```\n\n```js\nvar odataQuerySql = require(\"odata-query-sql\");\nvar oquery = { $expand: \"category\", $filter: \"title eq 'moby dick'\", $select: \"title\"};\nvar options = { resource: \"book\", dialect: \"mysql\" }\nvar result = odataQuerySql(oquery, options);\n// result.value: \"select * from book where title = 'moby dick' limit 50\"\n// result.expand.category: \n// \"select * from category where id in (select category_id from book where title = 'moby dick')\"\n```\n\nCHANGELOG\n---------\n* 0.0.1 (15 Aug 2016) first release","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlight%2Fodata-query-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funlight%2Fodata-query-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlight%2Fodata-query-sql/lists"}