-
Notifications
You must be signed in to change notification settings - Fork 48
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
Feat relationships #246
Merged
Merged
Feat relationships #246
Changes from 190 commits
Commits
Show all changes
196 commits
Select commit
Hold shift + click to select a range
72752b5
Add relationships base
abnegate db87b17
Remove foreign key use
abnegate 78b1cff
WIP add fetching related documents
abnegate d69861e
Move tests to base
abnegate 901c5f6
Hacky fix for circular one-to-one reference fetches
abnegate 318a459
Working one to many
abnegate 783ed8b
Fix two way related fetch from child side
abnegate 88d3c19
Update collections
abnegate 5aa3f68
Use switch for document reference relation type
abnegate b5e9768
Fix junction name
abnegate 2286537
Add `private` attribute to metadata collection to hide junction colle…
abnegate ba664bc
Move anonymous function to class level
abnegate cd6f05a
Remove private changes
abnegate 59f16c9
Remove private key
abnegate 8299921
Working many to many
abnegate 378431e
Many to one
abnegate 3fe54a5
Add update relationships
abnegate d7cc289
WIP add delete relationships
abnegate 22991eb
Add rest of delete tests
abnegate 4da89c9
Add indexes
abnegate 4a19b82
Fix test order
abnegate 1e51392
Unlimited related documents
abnegate 1476212
Populate relationships from find
abnegate a9852a1
Support relationship property queries
abnegate 7962efa
WIP document relationship updates
abnegate 941e597
Unique key index for one to one relations
abnegate c70a44b
Add relationship updating
abnegate bb77b72
WIP delete documents with relationships
abnegate 2ec8b52
Merge remote-tracking branch 'origin/main' into feat-relationships
abnegate 8d52a50
Merge remote-tracking branch 'origin/main' into feat-relationships
abnegate cea1858
Merge remote-tracking branch 'origin/main' into feat-relationships
abnegate 0080797
Fix updating on update/delete
abnegate 4f97ebb
One to one delete
abnegate ccb67df
Check fixes
abnegate 932957b
Format
abnegate 73adc93
Set null / cascade on delete
abnegate bce8e5f
Many to many cascade delete
abnegate 8a7e29c
Rename delete methods
abnegate fa02062
WIP nested selects
abnegate 974959b
Add nested selects using chained queries
abnegate bf2d852
Fix one-to-many and many-to-one not removing old relations on update
abnegate 99911e2
Fix many-to-one caching
abnegate 3c01064
Delete relation cache for many to many so nested items are re-fetched
abnegate d9e6eba
Add checks to test for relationship nesting
abnegate bbe883c
Fix over-fetched nesting
abnegate cf7dd89
Fix creating documents with two-way relations from child-side
abnegate aa20d08
Fix infinite recursion when creating multi-level nested documents
abnegate 2b20d17
Fix upsert related documents
abnegate 865b19a
Add tests for creating two-way relations from child side
abnegate 9811183
Fix nested relationship fetches for some types
abnegate e4f19a0
Add method stubs
abnegate 343de80
Change PDO to mixed
abnegate dc842d7
Change method return to mixed
abnegate 4388984
Fix more nested fetches
abnegate f01e936
Check fixes
abnegate fe29a04
Add extra test cases for missing coverage
abnegate e396c00
Add Postgres relationships
abnegate 352a161
Fix Postgres select * queries
abnegate cdabfe0
Fix default index creation
abnegate 509d139
Add explicit `index` prefix to avoid index/table name collisions in P…
abnegate 3304a5d
Fix postgres tests
abnegate ec6b399
Recreate databases for each test
abnegate f158f63
Fix index meta not updated with renamed relationships
abnegate f6f1190
Add mongo support
abnegate 697a9b0
Format
abnegate 7d22708
Remove on update as document IDs can never be updated
abnegate 8b3ea61
Remove other update usages
abnegate 0ec2635
Add test for inherited permissions
abnegate 9bb8783
Permissions inherit/enforcement tests
abnegate 35c6e2e
Check max depth for document creation
abnegate 2851954
Fix create document with relationships not returning populated relati…
abnegate a0b0835
Fix one to one updates with new documents
abnegate 17c6b66
Fix one to one updates for all creation types
abnegate ab6c773
Fix one to many updates for all creation types
abnegate 574de81
Don't filter newly added documents for update
abnegate 62eb6e7
Fix many to one updates for all creation types
abnegate bd43a63
Fix many to many updates for all creation types
abnegate bb39da6
Test for updating via all types from child side for two way relations…
abnegate 663a0de
Fix empty state test
abnegate 594d7c5
Inherit parent permissions on update
abnegate 8c64d6b
Skip fetching relationships when removing from old documents on update
abnegate 718fb5d
Skip relationships past max depth on update
abnegate c233735
Test update through create
abnegate c1412e0
Update mongo
abnegate 73c48d6
Remove SQLite test db recreate
abnegate 5610fb0
Add relationship support flag to disable for problematic adapters
abnegate c313463
Fix phpstan
abnegate 3dac815
Allow updating two way
abnegate f56a2c8
Skip updating columns names if key matches the original
abnegate 277828f
Don't update anything if no new values were passed
abnegate c97273d
Make sure auth status is reset in case of exception inside callback
abnegate 5505887
Add assertions for update on create test
abnegate 1ce6b21
Fix delete with no related items when on delete set to restrict
abnegate e30fae5
Test for delete with no related documents when on delete set to restrict
abnegate 4505743
Remove test code
abnegate 9c6e449
Update index var names
abnegate ba5b3ea
Update default relationship key values
abnegate 350f801
Short circuit loops
abnegate 6943e0f
Clean up select query processing for relationships
abnegate 649bd0c
Apply suggestions from code review
abnegate c998b0e
Arrow function usages
abnegate e6bb18b
Update src/Database/Database.php
abnegate b5c3b13
Review feedback
abnegate 303438b
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
abnegate 40bd069
Use instance vars instead of statics for depths
abnegate aae2f88
Format
abnegate 3284d92
Merge remote-tracking branch 'origin/main' into feat-relationships
abnegate 825ea1c
Add null checks
abnegate 685feba
Fix many to one one way meta checks
abnegate c1df0b7
Fix one to many one way key checks
abnegate a3a71bf
Add missing `silent` for some calls
abnegate 851deda
Fix test cases for metadata
abnegate 269c528
Check fixes
abnegate fa0f6a7
Add test for many related to one
abnegate 6b4b365
Add extra many-many case
abnegate 29b7126
Allow adding hooks to pre/post process documents with the collection …
abnegate 7d198b0
Remove pre-delete hook
abnegate 88d9746
Remove redundant throws defs
abnegate 94c4385
Merge branch 'feat-hooks' into feat-relationships
abnegate faf43ac
Revert "Merge branch 'feat-hooks' into feat-relationships"
abnegate 91d81fb
Revert "Revert "Merge branch 'feat-hooks' into feat-relationships""
abnegate 5683ad2
Revert "Revert "Revert "Merge branch 'feat-hooks' into feat-relations…
abnegate 49b827b
Throw exception when deleting child side one-to-one with related parent
abnegate a0d62c7
Add test for one-to-one one way child side delete
abnegate a51b3db
Allow deleting child one-to-one relation when one-way
abnegate ed91c85
Prefix internal collections and indexes with _ so names can never col…
abnegate 15a7158
Reset keys when unsetting from lists
abnegate 7001161
Fix deleting two-way relationship from child side
abnegate 4659f00
Fix deleting relationships on collection delete
abnegate 5df27b1
Fix junction not delete from metadata table
abnegate 629652a
Add tests for deleting two way relationship from child side
abnegate a5bed05
Add one to many list array with $id together
fogelito c6d20e0
Add one to many list array with $id together
fogelito e3162cb
LimitException Duplication
fogelito b5d98c7
Fix analysis
abnegate f9e242a
Fix removing attributes with null values
abnegate 22edc68
check cascade delete with no limits
fogelito 2fe2ba4
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
fogelito 1472c47
Fix analysis
abnegate b9bfc46
Select operator and filter fixes
fogelito 897a025
remove var_dump
fogelito 98f1fe0
Fix analysis
abnegate 76fc55c
linter commit
fogelito fb62db6
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
fogelito 5e4292f
Some more assertArrayNotHasKey tests on find method
fogelito da5f08e
dormitories
fogelito d8752a8
Tests to be check
fogelito 5c4ddcb
Update rename parameter
abnegate 0ca9f61
Fix delete attribute not removing attribute from index metadata
abnegate a1e53fa
Use key length const instead of magic number
abnegate 96a10d8
Return true on empty query for relationship delete
abnegate 04e8f61
Check if attribute key or twoWayKey already exists when trying to rename
abnegate 76e6f33
Remove redundant param from adapter relationship create
abnegate b7e3568
Format
abnegate 285474a
Fix tests
abnegate 628170c
Fix tests
abnegate 9ac58dc
Fix tests
abnegate 0526571
Merge remote-tracking branch 'origin/main' into feat-relationships
abnegate c7f9e47
Fix nested select tests
abnegate f25f144
Copy fix select queries for `getDocument`
abnegate c7a55cb
Tests Select operator on 3 level nesting
fogelito 9c8af66
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
fogelito c540ce2
Tests Select operator on 3 level nesting
fogelito 8b1244b
Fix analysis
abnegate cfa79e4
Fix update set to null for one-to-many child side
abnegate 8c9cd48
Disable delete relationship on regular attribute
fogelito 280d9da
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
fogelito 08e6f74
Disable delete relationship on regular attribute
fogelito a9de5d6
Skip relationships on related fetch to preserve unchanged values
abnegate 6e5e5ce
Format
abnegate 8d75406
Fix many to many update with removal
abnegate 05a3f8c
Select operator on getDocument
fogelito 552883e
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
fogelito b450b0b
Fix many to many update with removal
abnegate c0e90dd
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
abnegate 2f9c43c
Add restricted exception
abnegate ac604e7
Format
abnegate e5dd71a
Fix special characters in junction table keys
abnegate ce2ee8e
Cache test on updating related document
fogelito c84d5fb
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
fogelito 6fc3911
Add limit checks for related collection on relationship create
abnegate 4080f8d
Fix special characters in attribute names
abnegate 038499c
Fix special characters in relationship names
abnegate 2c8e678
POC for cache clean up
fogelito a1f4776
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
fogelito e83f2df
remove comments
fogelito 2db552f
Some Test and Optimize
fogelito 6273c4d
Delete restrict OneToOne allow from child side
fogelito 52d31cb
Use internal collection IDs for junction collection ID
abnegate 853f9b7
Fix one to one duplicate checks
abnegate 0e5edd8
skip relations
fogelito f98ed87
Merge remote-tracking branch 'origin/feat-relationships' into feat-re…
fogelito 1cee8b7
skipRelationships + add kill database object
fogelito 31c1d15
Change SQLiteTest.php DSN to memory
fogelito 6321d09
Check status and throw on attribute/relationship create/update/delete…
abnegate 84a3aea
Use return values to make code more readable
abnegate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of those rare PRs where the lock file has lesser changes than the rest! Love it 😄