Repository navigation
test(basic): contract read-only and keyless models - #30
Merged
Merged
Conversation
Add sync/async cross-backend contracts for ReadOnlyMixin, the value-based write gate, every refused write path, reads that stay available, __primary_key__ = None, and UnaddressableRecordError. The contracts reuse the provider's users table and add no DDL.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Adds the shared sync/async contracts for read-only models and keyless models, and covers their interaction with the newly merged
find_one_or_create.ReadOnlyMixindeclaration, theread_only()predicate, the value-based gate, every refused write path,ReadOnlyErrortype and fields, and reads that stay available.__primary_key__ = None, empty key columns/tuples, provenance-basedis_new_record, andUnaddressableRecordErrorfor identity-based access.find_one_or_createinteraction: an existing read-only row is returned without writing; a missing row reaches the samesavegate and raisesReadOnlyError.userstable without adding DDL.rhosocial/python-activerecord#135.Adds: N/A (no tracking issue).
Type of change
feat: A new featuredocs: Documentation only changes (if related to the new feature)perf: A code change that improves performance (if part of the feature)test: Adding missing tests or correcting existing tests (for the new feature)chore: Changes to the build process or auxiliary tools and libraries suchs as documentation generation (if related to the new feature)ci: Changes to our CI configuration files and scripts (if related to the new feature)build: Changes that affect the build system or external dependencies (if related to the new feature)revert: Reverts a previous commitBreaking Change
(If Yes, please describe the impact and migration path below):
N/A
Applicable
rhosocial-activerecordVersion Range:rhosocial-activerecord>=1.0.0.dev30,<2.0.0Related Repositories/Packages
rhosocial/python-activerecordbranchfeature/readonly-modelsaddsReadOnlyMixin,ReadOnlyError, keyless models and object declarations.basic/readonlyandbasic/nopkmodules after the core/testsuite batch merges.Testing
Test Plan:
The
find_one_or_createinteraction tests also pass locally against SQLite. The companion core PR runs the full matrix.Checklist
README.md, etc.).changelog.d/<issue_number>.<type>.md).Additional Notes
This repository has no self-test workflow. The shared tests are validated by the companion core CI run. The changelog fragment is intentionally added after the PR number and CI result are known.