0.2.0 • Published 8 years ago

azure-odata-sql v0.2.0

Weekly downloads
392
License
MIT
Repository
github
Last release
8 years ago

azure-odata-sql

This library contains functionality to convert OData queries into SQL statements.

The library uses types from the mssql npm package to represent parameter types. The query object is in the format produced by azure-query-js.

Installation

npm i azure-odata-sql

Usage

The library currently exports a single function:

require('azure-odata-sql').format(query, tableConfig)

The query parameter is an object with any of the following properties:

PropertyDescription
skipNumber of rows to skip
takeNumber of rows to take
inlineCountSet to allpages to include a total count query
resultLimitNumber of rows to limit the query to
selectionsColumns to select
filtersFilters to apply
orderingColumns to sort by
idRecord identifier
includeDeletedInclude soft deleted columns

The tableConfig is an object with any of the following properties:

PropertyDescription
nameThe name of the table being queried
schemaThe database schema name for the table
flavorEither mssql or sqlite
softDeleteTrue if the table supports soft delete with a column called deleted