-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix: lookup-formula-nested #11307
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
fix: lookup-formula-nested #11307
Conversation
Warning Rate limit exceeded@o1lab has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 34 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (6)
📝 Walkthrough## Walkthrough
The changes introduce a new type alias `TAliasToColumnParam` to standardize parameter passing for formula query builder functions. All relevant functions and their invocations are updated to accept this parameter object, which includes optional `tableAlias` and `parentColumns` properties. Alias count management is centralized for consistency during recursive formula query construction. Additionally, some code is refactored to avoid mutating original column objects and to centralize context resolution.
## Changes
| Files/Paths | Change Summary |
|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| `.../formula-query-builder.types.ts` | Introduced `TAliasToColumnParam` type alias; updated `TAliasToColumn` to use the new parameter object. |
| `.../formulaQueryBuilderv2.ts` | Updated all `aliasToColumn` function signatures and invocations to use `TAliasToColumnParam` object; standardized parameter passing.|
| `.../lookup-or-ltar-builder.ts` | Changed builder function to accept `{ tableAlias, parentColumns }` object; centralized alias count management for consistency. |
| `.../mapFunctionName.ts` | Changed `MapFnArgs.aliasToCol` property type to use imported `TAliasToColumn` alias instead of inline type. |
| `.../field-handler/handlers/formula/formula.general.handler.ts` | Modified `verifyFilter` to avoid mutating the original column by creating a new column instance with updated `uidt`. |
| `.../field-handler/index.ts` | Centralized context resolution in `verifyFiltersSafe` method by assigning `context` variable for reuse. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant Caller
participant FormulaQueryBuilder
participant AliasToColumnFunc
Caller->>FormulaQueryBuilder: call _formulaQueryBuilder({tableAlias, parentColumns})
FormulaQueryBuilder->>AliasToColumnFunc: call aliasToColumn[col.id]({tableAlias, parentColumns})
AliasToColumnFunc-->>FormulaQueryBuilder: Promise<{ builder }>
FormulaQueryBuilder-->>Caller: SQL builder result Possibly related PRs
Suggested reviewers
|
Uffizzi Ephemeral Environment Deploying☁️ https://app.uffizzi.com/github.com/nocodb/nocodb/pull/11307 ⚙️ Updating now by workflow run 14882935325. What is Uffizzi? Learn more! |
3d5a2c5
to
f08c9e6
Compare
f08c9e6
to
dc58e6a
Compare
Change Summary
fix: lookup-formula-nested. Closes #11299
Change type