Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
953 stars 197 forks source link

[Enhancement]: Add an OData Endpoint #2372

Open JerryNixon opened 2 months ago

JerryNixon commented 2 months ago

What is it?

Today DAB supports /api and /graphql, this introduces /odata.

What is OData?

OData (Open Data Protocol) is an advanced REST-based protocol designed for querying and updating data, allowing for more flexible and granular interaction with data than traditional REST. Unlike standard REST, which typically operates on individual resources and has predefined endpoints, OData supports advanced querying features like filtering, sorting, paging, and data expansion directly through query parameters. OData enables clients to request specific subsets of data using standardized parameters such as $filter, $select, and $orderby, making it particularly useful for data-driven applications. While REST defines basic CRUD operations, OData extends this by adding a structured query syntax, metadata discovery, and model relationships, making it more suited for complex and dynamic data scenarios.

Feature Description
CRUD Operations Supports Create, Read, Update, Delete operations on resources, just like standard REST APIs.
Advanced Querying Provides powerful querying capabilities using $filter, $select, $orderby, and $top, allowing clients to specify exactly what data they need.
Filtering Allows filtering of results using $filter with logical operators (e.g., eq, gt, lt). Example: ?$filter=age gt 25.
Sorting Supports sorting results using $orderby. Example: ?$orderby=name desc.
Paging Provides paging with $top and $skip to limit the number of results and skip specific records. Example: ?$top=10&$skip=20.
Data Expansion Expands related entities in a single request using $expand. Example: ?$expand=orders to include associated orders with a customer.
Metadata Discovery Exposes a $metadata endpoint that describes the structure and relationships of the data model, allowing clients to understand the API’s schema without external docs.
Data Relationships Navigates between related entities seamlessly, enabling efficient querying of relationships such as one-to-many or many-to-many.
Batch Requests Supports batching multiple requests into a single HTTP request, reducing overhead for applications needing to send multiple queries at once.
Custom Actions/Functions Allows defining custom server-side actions or functions to extend the functionality of the API beyond basic CRUD operations.
JSON & XML Response Supports both JSON and XML response formats, giving flexibility in how data is returned to the client.
Count Functionality Returns the number of items in a collection using $count. Example: ?$count=true to return the total number of records that match the query.
Security & Authorization Supports OAuth and other authentication mechanisms, and can apply access control policies to specific entities or actions based on user roles and permissions.

Questions

  1. Do we have what we need in our current configuration? Research required.

Related issues to close