- Notifications
You must be signed in to change notification settings - Fork19
jaystack/odata-v4-sql
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Service OData v4 requests from an SQL data store.
The OData V4 SQL Connector provides functionality to convert the various types of OData segmentsinto SQL query statements, that you can execute over an SQL database.
- Create high speed, standard compliant data sharing APIs
import{createFilter}from'odata-v4-sql'//example request: GET /api/Users?$filter=Id eq 42app.get("/api/Users",(req:Request,res:Response)=>{constfilter=createFilter(req.query.$filter);// request instance from mssql modulerequest.query(`SELECT * FROM Users WHERE${filter.where}`,function(err,data){res.json({'@odata.context':req.protocol+'://'+req.get('host')+'/api/$metadata#Users',value:data});});});
Advanced TypeScript example availablehere.
varcreateFilter=require('odata-v4-sql').createFilter;app.get("/api/Users",function(req,res){varfilter=createFilter(req.query.$filter);// request instance from mssql modulerequest.query(filter.from("Users"),function(err,data){res.json({'@odata.context':req.protocol+'://'+req.get('host')+'/api/$metadata#Users',value:data});});})
- $filter
- $select
- $skip
- $top
- $orderby
- $expand
About
OData V4 SQL
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.