linquest - Remote Linq implementation with Jinqu infrastructure
Written completely in TypeScript.
Installation
npm i linquest
Let's See
// first, create a serviceconst service = 'https://my.company.service.com/';// then create a queryconst query = servicecreateQuery<Company>'Companies';// execute the queryconst result = await query;
Request providers
Linquest uses fetch as default, you might need to use a polyfill.
To use a custom request provider, you need to implement IAjaxProvider interface from jinqu
; // implement the IAjaxProvider interface implements IAjaxProvider ajax<T>o: AjaxOptions: Promise<T> // implement this // inject provider to LinqServiceconst service = 'https://my.company.service.com/' ;
Code Generation
With code generation from a metadata (like Swagger or OpenAPI, you can really simplify the usage.
// generated code { super'https://my.company.service.com/' provider; } { return thiscreateQuery<Company>'Companies'; } // and you can use it like thisconst service = ;const query = service);const result = await query;
Old Browsers
linquest uses jinqu as a querying platform, if you want to use jinqu features with old browsers, please refer to jinqu documentation.
License
Linquest is under the MIT License.