ts-rsql-query v1.3.4 transforms the AST from ts-rsql into a SQL WHERE clause with parameterized values. It provides an SqlContext with configurable selectors, operators, keyword casing, and parameter offset support. Unlike generic SQL builders, it is purpose-built for RSQL query strings and integrates tightly with ts-rsql's parser. Released under MIT, it follows a stable release cadence with active maintenance. Key differentiators include plugin support for custom operators and alignment with the ts-rsql ecosystem.
npm install ts-rsql-queryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates initializing an SqlContext with selectors and calling queryFromRsql to generate a parameterized SQL WHERE clause.
Ensure all selectors referenced in the RSQL string are defined in SqlContext selectors, or set lax: true to skip undefined selectors.
Pre-populate the 'values' array with any parameters from the base query before passing to queryFromRsql.
Avoid using whereKeywordPrefix; rely on the default or format manually.
Whitelist or sanitize order-by values externally to prevent SQL injection.
Use string literals like 'NUMBER' | 'VARCHAR' instead of importing an enum.
Define the missing selector in the selectors map or set lax: true in SqlContext.
Set 'moduleResolution' to 'node16' or 'bundler' in tsconfig.json and ensure 'module' is 'ESNext' or similar.
Add a 'type' field to each selector config (e.g., type: 'NUMBER' | 'VARCHAR').
Validate the RSQL string to ensure order-by parts refer to valid selectors, or upgrade ts-rsql-query to a version with better error handling.
No dependency data recorded yet.