OData V4 to PostgreSQL query compiler that converts OData query segments ($filter, $select, $orderby, $expand, $skip, $top) into SQL statements for PostgreSQL. Version 0.1.1 is the latest, with sporadic releases. It differs from alternatives like odata-v4-mysql by targeting PostgreSQL, supporting all standard OData query options, and providing a simple createFilter function that returns { where, parameters } for direct use with the pg driver.
npm install odata-v4-pgNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates parsing an OData $filter expression and executing the resulting SQL query against PostgreSQL.
Use filter.where for SQL clause and filter.parameters for parameterized values.
Avoid deep or multiple nested $expand queries; flatten relations manually.
Use `createFilter()` directly with your own Express endpoints.
Always pass filter.parameters as query parameters to the pg client.
Ensure $filter is a valid OData expression string (e.g., 'Id eq 42').
Use exact column names (e.g., 'id' instead of 'Id') or quote them accordingly.
Install the latest version (npm install odata-v4-pg@latest) and use `import { createFilter } from 'odata-v4-pg'`.