-
Notifications
You must be signed in to change notification settings - Fork 2
feat(fmodata): add OData string functions matchesPattern, tolower, toupper, trim #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(fmodata): add OData string functions matchesPattern, tolower, toupper, trim #114
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@proofkit/better-auth
@proofkit/cli
create-proofkit
@proofkit/fmdapi
@proofkit/fmodata
@proofkit/typegen
@proofkit/webviewer
commit: |
a42732f to
ec08889
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| TInput = TOutput, | ||
| TableName extends string = string, | ||
| IsContainer extends boolean = false, | ||
| > extends Column<TOutput, TInput, TableName, IsContainer> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ColumnFunction transform silently ignored in orderBy operations
Low Severity
The new ColumnFunction class extends Column, making it type-compatible with asc() and desc() operators. However, the orderBy serialization in query-builder.ts uses column.fieldName directly, which for ColumnFunction returns only the underlying field name without the function wrapper. This means asc(tolower(users.name)) compiles successfully but the tolower transform is silently ignored, producing $orderby=name asc instead of the expected $orderby=tolower(name) asc. Users attempting case-insensitive sorting would get unexpected results.



Note
Medium Risk
Touches core filter serialization by adding a new
Columnsubtype and operand-handling logic, which could subtly affect query-string generation. Changes are additive and covered by new unit tests, keeping risk contained.Overview
Adds new OData filter capabilities to
@proofkit/fmodata: amatchesPattern(column, pattern)string operator and nestable string transform helperstolower,toupper, andtrimthat can wrap columns and be used with existing operators (e.g.,eq(tolower(col), 'x')).Implements a new
ColumnFunctionwrapper (plusisColumnFunction) to serialize transforms, including correct field quoting and support for entity IDs, and wires these new exports through the public API. Updates docs/reference material and extends filter/ORM tests to cover the new operator, nested transforms, quoting behavior, and entity-id serialization.Written by Cursor Bugbot for commit ec08889. This will update automatically on new commits. Configure here.