Bugfix:
- Fix Boolean value based plugins do not work with validation (in case of typed selector values) and will fail with unexpected error.
- Plugin configuration section of README.md updated.
IMPORTANT NOTE: the fix affects boolean-value-based plugins (like the provided
IsNullPlugin) which might be created by developers so far in a "non-backwards-compatible" way.Migration path: add
allowedValues: : [ 'value1', value2, ...]to yourRsqlOperatorPluginconfiguration to enable a proper functionality of your custom plugin.
Internals:
- Tests added for fix.
- Added new
Makefiletarget:tlto execute live-DB tests. - Fix
lastModifiedselector-column mapping inTestQueryConfig(column was configured case-sensitive in DB but not in selector).
Bugfixes:
Bugfixes:
- Fix No wildcard(s) support for
!=operator. - Fixed a bug where
RsqlOperatorPluginToSqlOptions.keywordsLowerCasewas not passed to the options when it would be configured totrue. - Corrected implementation examples for plugin section in (./README.md#plugins).
Internals:
- Added some bugfix related (non-)equality tests to live-DB.
- Git- and npm-ignored
.vscode/folder. - Fixed internal function
toSqlOperatorto return SQL=for RSQL==operator (actually, case was never used before, but now it is used and fixed therefore). - Added some bugfix related (non-)equality tests to live-DB.
Internals:
- Update ``to
node-version: 20.x.
New feature implementations:
- New plugin architecture with:
- Creation of custom operator plugins.
- Overwriting of known (standard) operators.
- Usage of predefined plugins:
- Is-Any: Overwrite of
=in=(mapped to PostgreSQL's= ANY(...)). - Is-Not-All: Overwrite of
=out=(mapped to PostgreSQL's<> ALL(...)). - Is-Null:
=null=[true | false]=>IS [ NOT ] null - Is-Empty:
=empty=[true | false]=>[ = | <>] ''. - Is-Null-Or-Empty:
=nullorempty=[true | false]=>(... IS [ NOT ] null OR ... [ = | <>] '').
- Is-Any: Overwrite of
- Exported new function
formatKeyword(keyword: string, keywordsLowerCase = false)to be usable in plugins. - Exported existing function
formatSelector(context: SqlContext, selector: string)to be usable in plugins. - Exported existing function
formatValue({ allowArray, ast }: { ast: ComparisonNode; allowArray?: boolean }, config: StaticQueryConfig)to be usable in plugins.
- Extended configuration:
- Plugins from above (
plugins, default:undefined). - SQL cosmetics:
- SQL keyword lower-case and UPPER-case configuration (default: UPPER).
- NOTE: Since this was somehow a mixed style before, this is unified to upper-case now and therefore is not fully "backwards compatible".
- Plain SQL operators with SPACE around or not (
detachedOperators, default:false). - Prefix configuration for
WHERE(whereKeywordPrefix, default:" ").
- SQL keyword lower-case and UPPER-case configuration (default: UPPER).
- Plugins from above (
Internals:
- Added
.editorconfig - Some minor code adaptions/refactorings.
- Some unit tests added.
- Some js-doc added.
- Added new test-coverage script:
npm run test:coverage. coveragefolder ignored from Git.- Added a
Makefilefor convenience (optional usage, requires UNIX-like environment). - Added
Changelog.md.
Initial Implementation and bugfixes.