When creating a model with a nested many-to-many `connect`, the join table
insert triggered an update-policy check on the just-created entity. Because
the connection doesn't exist yet at check time, relation-based policies
(e.g. `parents?[id == auth().id]`) always evaluated to false, causing a
spurious "not updatable" error.
Fix by embedding a lightweight marker in the insert query's end-modifier
comment so the policy handler can identify the newly-created side and skip
its circular update check. The connected side's update policy is still
enforced. Adds regression test for issue #2531.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* WIP(orm): mysql support
* WIP: more progress with fixing tests
* WIP: get all client api tests pass
* WIP: get all tests pass
* fix executor
* add MySQL to CI matrix
* fix sqlite test runs
* fix test
* fix delete readback check
* set mysql container max connections
* fix tests
* fix test
* refactor: extract duplicated mysql/pg code into base class
* address PR comments
* refactor: remove order by duplicated code
* refactor: optimize stripTableReference
* addressing PR comments
* fix tests
* feat: audit policy collection aliases
provides a means to alias collections in @@allow collections by extending the ast
this allows for utilizing collections inside of @@allow like:
```
memberships?[m,
auth().memberships?[
tenantId == m.tenantId ...
]
]
```
* fix: code review comments + syntax fixes
* refactor: extract collection predicate binding to its own language construct (#2)
- adjusted language processing chain accordingly
- fixed several issues in policy transformer/evaluator
- more test cases
* addressing PR comments
---------
Co-authored-by: Yiming Cao <yiming@whimslab.io>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
* feat(orm): implement client API extensions, refactor query args extension
* address PR comments
* Fix upsert validation to merge $create and $update schemas (#604)
* Initial plan
* fix: merge $create and $update schemas for upsert validation
- Handle upsert operation specially to match TypeScript type behavior
- When both $create and $update schemas exist, merge them for upsert
- Add test case to verify the fix works correctly
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
* fix: improve comment accuracy about Zod merge behavior
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
* minor fixes
---------
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>