{"id":20494055,"url":"https://github.com/jaystack/odata-v4-mssql","last_synced_at":"2025-04-13T17:21:30.797Z","repository":{"id":57313451,"uuid":"73910478","full_name":"jaystack/odata-v4-mssql","owner":"jaystack","description":"OData to MS-SQL query compiler","archived":false,"fork":false,"pushed_at":"2021-10-23T02:52:01.000Z","size":14,"stargazers_count":6,"open_issues_count":3,"forks_count":4,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-27T08:11:22.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jaystack.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":"2016-11-16T10:46:41.000Z","updated_at":"2021-11-18T13:52:08.000Z","dependencies_parsed_at":"2022-09-20T23:30:36.418Z","dependency_job_id":null,"html_url":"https://github.com/jaystack/odata-v4-mssql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaystack%2Fodata-v4-mssql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaystack%2Fodata-v4-mssql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaystack%2Fodata-v4-mssql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaystack%2Fodata-v4-mssql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaystack","download_url":"https://codeload.github.com/jaystack/odata-v4-mssql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248680072,"owners_count":21144604,"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-15T17:38:02.699Z","updated_at":"2025-04-13T17:21:30.777Z","avatar_url":"https://github.com/jaystack.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OData V4 Service modules - SQL Connector\n\nService OData v4 requests from an SQL data store.\n\n## Synopsis\nThe OData V4 SQL Connector provides functionality to convert the various types of OData segments\ninto SQL query statements, that you can execute over an SQL database.\n\n## Potential usage scenarios\n\n- Create high speed, standard compliant data sharing APIs\n\n## Usage as server - TypeScript\n```javascript\nimport { createFilter } from 'odata-v4-sql'\n\n//example request:  GET /api/Users?$filter=Id eq 42\napp.get(\"/api/Users\", (req: Request, res: Response) =\u003e {\n    const filter = createFilter(req.query.$filter);\n    // request instance from mssql module\n    request.query(`SELECT * FROM Users WHERE ${filter.where}`, function(err, data){\n        res.json({\n        \t'@odata.context': req.protocol + '://' + req.get('host') + '/api/$metadata#Users',\n        \tvalue: data\n        });\n    });\n});\n```\n\nAdvanced TypeScript example available [here](https://raw.githubusercontent.com/jaystack/odata-v4-sql/master/src/example/sql.ts).\n\n## Usage ES5\n```javascript\nvar createFilter = require('odata-v4-sql').createFilter;\n\napp.get(\"/api/Users\", function(req, res) {\n    var filter = createFilter(req.query.$filter);\n    // request instance from mssql module\n    request.query(filter.from(\"Users\"), function(err, data){\n        res.json({\n        \t'@odata.context': req.protocol + '://' + req.get('host') + '/api/$metadata#Users',\n        \tvalue: data\n        });\n    });\n})\n```\n\n## Supported OData segments\n\n* $filter\n* $select\n* $skip\n* $top\n* $orderby\n* $expand","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaystack%2Fodata-v4-mssql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaystack%2Fodata-v4-mssql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaystack%2Fodata-v4-mssql/lists"}