Skip to content

feat: initial structure for zmodel schema#1

Merged
ymc9 merged 1 commit into
devfrom
feat/init_schema
Sep 23, 2022
Merged

feat: initial structure for zmodel schema#1
ymc9 merged 1 commit into
devfrom
feat/init_schema

Conversation

@ymc9

@ymc9 ymc9 commented Sep 23, 2022

Copy link
Copy Markdown
Member

No description provided.

@ymc9 ymc9 merged commit a6b415d into dev Sep 23, 2022
@ymc9 ymc9 deleted the feat/init_schema branch October 25, 2022 13:48
ymc9 added a commit that referenced this pull request Feb 10, 2026
* WIP

* got todo sample running with policies
hechang27-sprt added a commit to hechang27-sprt/zenstack that referenced this pull request Jun 26, 2026
…t array columns in subqueries

Fix zenstackhq#1: In _member() isThis branch, pass modelOrType: context.thisType
to transformRelationAccess() so that this.relation.field correctly
resolves relation fields against the @@Allow model (thisType) rather
than the collection predicate's model (modelOrType).

Fix zenstackhq#2: In _member() when the innermost field of a subquery selection
is an array type AND the provider is PostgreSQL, wrap the column with
unnest() so that ANY(subquery) receives scalar rows instead of array
rows. Other providers (SQLite, MySQL) leave the column as-is since
they store arrays differently (JSON) and would need different handling.
hechang27-sprt added a commit to hechang27-sprt/zenstack that referenced this pull request Jun 26, 2026
…field in operator

Two PG-specific tests covering the fixes:
- Fix zenstackhq#1: this.relation.field resolves against @@Allow model in
  collection predicates (e.g. auth().permissions?[p, p.clearance >=
  this.author.level])
- Fix zenstackhq#2: this.scalarField in this.relation.arrayField generates
  unnest() for PG subqueries (e.g. this.id in this.group.visibleDocIds)
hechang27-sprt added a commit to hechang27-sprt/zenstack that referenced this pull request Jun 26, 2026
…field in operator

Two PG-specific tests covering the fixes:
- Fix zenstackhq#1: this.relation.field resolves against @@Allow model in
  collection predicates (e.g. auth().permissions?[p, p.clearance >=
  this.author.level])
- Fix zenstackhq#2: this.scalarField in this.relation.arrayField generates
  unnest() for PG subqueries (e.g. this.id in this.group.visibleDocIds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant