orm: deprecate global tenant filter APIs, deadline 2027-06-08 - #27389
Conversation
The old global tenant filter mechanism (configure_tenant_filter, set_current_tenant_id, with_tenant, without_tenant_filter, etc.) is replaced by the per-instance DataScope / orm.DB pattern. Add @[deprecated] and @[deprecated_after] attributes to all 10 public items so users get a notice directing them to the new API. See: PR vlang#27324 (DataScope support)
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1da1bf7fbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ckends) apply_tenant_filter is an internal helper called by the sqlite, mysql, and pg ORM backends in their select/update/delete paths. Marking it @[deprecated] would produce notices in every ORM-backed build and become a hard error after the grace period, breaking the backends. Keeps the 9 user-facing APIs deprecated as-is.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49a4b01550
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ckends) The apply_tenant_filter function is internal plumbing still used by db/sqlite, db/pg, and db/mysql backends. Deprecating it with -W in CI causes every tool that imports db/sqlite or any .vv test that imports it to fail. Keeps the other 9 deprecation markers (TenantFilterConfig, configure_tenant_filter, set_tenant_filter_enabled, set_current_tenant_id, clear_current_tenant_id, with_tenant, with_tenant_value, without_tenant_filter, without_tenant_filter_value). Fixes all 19 CI failures in PR vlang#27389.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 223b2571da
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Follow-up to #27154, after #27324
The old global tenant filter mechanism (
configure_tenant_filter/set_current_tenant_id) has been replaced by the per-instanceDataScope/orm.DBpattern introduced in #27324. This PR adds@[deprecated]and@[deprecated_after: '2027-06-08']to all old public APIs, guiding users to migrate with a one-year grace period.Summary
File changed:
vlib/orm/orm.v(+20 lines)Deprecation attributes added to 10 public items:
TenantFilterConfigorm.DataScopeconfigure_tenant_filterorm.new_db(conn, scope)set_tenant_filter_enabledorm.new_db(conn, scope)set_current_tenant_idQueryFiltertoDataScope.filtersclear_current_tenant_idorm.DBinstancewith_tenantorm.new_db(conn, scope)with_tenant_valueorm.new_db(conn, scope)without_tenant_filterorm.DB.unscoped()without_tenant_filter_valueorm.DB.unscoped()apply_tenant_filterorm.new_db(conn, scope)