Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
289 commits
Select commit Hold shift + click to select a range
9744868
(chore): simplify PHPStan config and remove baseline
abnegate Mar 14, 2026
bbe2cb0
(feat): add Event enum to replace string event constants
abnegate Mar 14, 2026
98e1474
(feat): add Lifecycle hook interface for database events
abnegate Mar 14, 2026
8b638ef
(feat): add QueryTransform hook interface for SQL query modification
abnegate Mar 14, 2026
5106488
(feat): add Async trait for parallel database operations
abnegate Mar 14, 2026
7ea6ef2
(feat): add query validators for aggregation, distinct, group by, hav…
abnegate Mar 14, 2026
28a886e
(test): add e2e test scopes for aggregation and join queries
abnegate Mar 14, 2026
d722b94
(refactor): remove local CursorDirection and OrderDirection enums in …
abnegate Mar 14, 2026
e12b5c2
(refactor): remove Mongo RetryClient in favor of built-in retry handling
abnegate Mar 14, 2026
92160fe
(refactor): use import alias for base Exception class and add docblocks
abnegate Mar 14, 2026
aa16406
(docs): add class-level docblocks to all exception subclasses
abnegate Mar 14, 2026
4b59b42
(refactor): improve ID helper with import alias and enhanced docblocks
abnegate Mar 14, 2026
ebbb5c9
(refactor): improve Role helper with import alias and enhanced docblocks
abnegate Mar 14, 2026
ff0175b
(refactor): improve Permission helper with enhanced docblocks
abnegate Mar 14, 2026
5d04b1a
(refactor): update DateTime helper with improved type safety
abnegate Mar 14, 2026
016a6ba
(refactor): update Connection class with improved docblocks
abnegate Mar 14, 2026
72460e2
(refactor): update PDO wrapper with improved type safety
abnegate Mar 14, 2026
5629360
(docs): add docblocks to enum and model classes
abnegate Mar 14, 2026
21cb52d
(feat): extend OperatorType enum with new cases and docblocks
abnegate Mar 14, 2026
54ca313
(refactor): change Operator method from string to OperatorType enum
abnegate Mar 14, 2026
314edd0
(refactor): remove backward compat constants and add aggregation/join…
abnegate Mar 14, 2026
38d9ec9
(refactor): improve Document type safety with PHPStan annotations and…
abnegate Mar 14, 2026
9879391
(refactor): improve Attribute model with PHPStan type annotations
abnegate Mar 14, 2026
c01b969
(refactor): improve Index model with PHPStan type annotations
abnegate Mar 14, 2026
672ac4c
(refactor): improve Relationship model with PHPStan type annotations
abnegate Mar 14, 2026
6528c41
(refactor): update adapter feature interfaces with docblocks and type…
abnegate Mar 14, 2026
cf22762
(refactor): replace string-based event system with Event enum and Que…
abnegate Mar 14, 2026
29c7ac7
(refactor): overhaul SQL adapter with query builder integration and t…
abnegate Mar 14, 2026
b9b58e2
(refactor): update MariaDB adapter for query lib integration
abnegate Mar 14, 2026
db306e5
(refactor): update MySQL adapter for query lib integration
abnegate Mar 14, 2026
382e89d
(refactor): update Postgres adapter for query lib integration
abnegate Mar 14, 2026
e8f5f64
(refactor): update SQLite adapter for query lib integration
abnegate Mar 14, 2026
ff015e9
(refactor): update Mongo adapter for query lib integration
abnegate Mar 14, 2026
bcc08e4
(refactor): update Pool adapter with typed delegates and query transf…
abnegate Mar 14, 2026
be9d715
(refactor): update Read, Write, and WriteContext hooks with docblocks
abnegate Mar 14, 2026
bab6d2d
(refactor): update permission hooks with type safety improvements
abnegate Mar 14, 2026
d4cbda7
(refactor): update tenant hooks with type safety improvements
abnegate Mar 14, 2026
5e03323
(refactor): update relationship hooks with type safety and docblocks
abnegate Mar 14, 2026
dd29e18
(refactor): replace event/listener system with Lifecycle hooks and si…
abnegate Mar 14, 2026
49598d6
(refactor): update Attributes trait for typed objects and Event enum
abnegate Mar 14, 2026
730d706
(refactor): update Collections trait for typed objects and Event enum
abnegate Mar 14, 2026
bf24dd0
(refactor): update Databases trait for Event enum
abnegate Mar 14, 2026
fd148e9
(refactor): update Documents trait for typed objects, Event enum, and…
abnegate Mar 14, 2026
cc64fb9
(refactor): update Indexes trait for typed objects and Event enum
abnegate Mar 14, 2026
9e9a526
(refactor): update Relationships trait for typed objects and Event enum
abnegate Mar 14, 2026
7280fd0
(docs): add docblock to Transactions trait
abnegate Mar 14, 2026
098e5e3
(refactor): update Mirror class for Lifecycle hooks and Event enum
abnegate Mar 14, 2026
d02398a
(refactor): update Mirroring Filter with type safety improvements
abnegate Mar 14, 2026
02a8b44
(refactor): update query validators with type safety and docblocks
abnegate Mar 14, 2026
2601f52
(refactor): update Attribute validator to use typed Attribute objects
abnegate Mar 14, 2026
10d348f
(refactor): update Index validators to use typed objects
abnegate Mar 14, 2026
85324a8
(refactor): update Operator validator for OperatorType enum
abnegate Mar 14, 2026
b41d2e2
(refactor): update Structure validators with type safety
abnegate Mar 14, 2026
aa7ef09
(refactor): update Queries validators with type safety and docblocks
abnegate Mar 14, 2026
c67dea4
(refactor): update Authorization validator with docblocks
abnegate Mar 14, 2026
9a86037
(refactor): update remaining validators with type safety and docblocks
abnegate Mar 14, 2026
f843e23
(test): update Operator tests for OperatorType enum changes
abnegate Mar 14, 2026
a18e4c5
(test): update Query tests for removed backward compat constants
abnegate Mar 14, 2026
fca7473
(test): update Document tests for type safety changes
abnegate Mar 14, 2026
445dbce
(test): update ID test import
abnegate Mar 14, 2026
b44043e
(test): update Attribute validator tests
abnegate Mar 14, 2026
e01d4bb
(test): update Index validator tests for typed objects
abnegate Mar 14, 2026
f6f9081
(test): update Structure validator tests
abnegate Mar 14, 2026
a7c3aa5
(test): update Query and Documents query validator tests
abnegate Mar 14, 2026
258ae8e
(test): update remaining unit validator tests
abnegate Mar 14, 2026
26946ce
(test): update e2e base adapter test class
abnegate Mar 14, 2026
9939205
(test): update Collection e2e tests for typed objects and Event enum
abnegate Mar 14, 2026
1b85a53
(test): update Document e2e tests for type safety changes
abnegate Mar 14, 2026
7b10d06
(test): update Attribute e2e tests
abnegate Mar 14, 2026
5d9fe92
(test): update Index e2e tests for typed objects
abnegate Mar 14, 2026
6a0f624
(test): update Spatial e2e tests for query lib changes
abnegate Mar 14, 2026
bb32e93
(test): update Relationship e2e tests for typed objects and Event enum
abnegate Mar 14, 2026
abbc77e
(test): update remaining e2e test scopes
abnegate Mar 14, 2026
1e702a2
(test): update SQL adapter e2e test configurations
abnegate Mar 14, 2026
1054409
(test): update MongoDB e2e test configurations
abnegate Mar 14, 2026
ebedcd2
(test): update Mirror e2e tests for Lifecycle hooks
abnegate Mar 14, 2026
62576d8
(test): update Pool adapter e2e test
abnegate Mar 14, 2026
4ecbe6f
(test): update SharedTables e2e test configurations
abnegate Mar 14, 2026
79cb0c2
(fix): resolve PHPStan errors in Mirror and Queries validator
abnegate Mar 16, 2026
577d710
(feat): add Collection model with toDocument/fromDocument
abnegate Mar 16, 2026
299c2e5
(feat): add optimistic locking with auto-incrementing document version
abnegate Mar 16, 2026
99b8eea
(feat): add rawQuery escape hatch and full-text search relevance scoring
abnegate Mar 16, 2026
73fc17e
(fix): add finally blocks for shared tables test cleanup and skip ten…
abnegate Mar 16, 2026
c993582
(feat): add ORM entity mapping with PHP 8.4 attributes and unit of work
abnegate Mar 19, 2026
2da66f8
(feat): add custom type registry, repository pattern, and specifications
abnegate Mar 19, 2026
5e5df73
(feat): add database seeding with factories, fixtures, and dependency…
abnegate Mar 19, 2026
43ad9e8
(feat): add typed domain events with PSR-14 compatible dispatcher
abnegate Mar 19, 2026
dd2a8d8
(feat): add second-level query cache with region config and auto-inva…
abnegate Mar 19, 2026
47a3d89
(feat): add eager/lazy loading with batch resolution and N+1 detection
abnegate Mar 19, 2026
d97d4e5
(feat): add query profiler with slow query detection and adapter inst…
abnegate Mar 19, 2026
18b3359
(feat): add fluent QueryBuilder exposing full utopia-php/query builde…
abnegate Mar 19, 2026
453878f
(feat): add schema introspection, migrations, and zero-downtime strat…
abnegate Mar 19, 2026
3c3640a
(feat): add read/write pool adapter with replica routing and sticky c…
abnegate Mar 19, 2026
fe5cc74
(test): add 301 unit tests for ORM, types, repository, seeder, events…
abnegate Mar 19, 2026
c7cc7ae
(feat): integrate utopia-php/query with performance optimizations and…
abnegate Mar 24, 2026
79e4c10
(test): refactor test suite with unit test coverage and PHPUnit 12 at…
abnegate Mar 24, 2026
8d002e0
(chore): upgrade to PHPUnit 12 and PHP 8.4
abnegate Mar 24, 2026
474f215
(fix): resolve SQLite execute override and Mirror constructor initial…
abnegate Mar 24, 2026
21d6c20
(test): restore e2e coverage and close unit test gaps for full covera…
abnegate Mar 24, 2026
c5d25bb
(fix): clone fixture documents to prevent test state leakage and re-c…
abnegate Mar 24, 2026
b078980
(fix): revert spatial Query::covers to Query::contains for cross-adap…
abnegate Mar 24, 2026
64b671e
Merge remote-tracking branch 'origin/main' into feat-query-lib
abnegate Mar 24, 2026
a6949b8
fix: add async library checkout to CI and regenerate composer.lock
abnegate Mar 24, 2026
980a619
fix: switch to VCS repos for query/async and simplify CI
abnegate Mar 24, 2026
d21d4ce
fix: resolve lint errors, add PHPStan baseline for max level, remove …
abnegate Mar 24, 2026
8d235cd
fix: resolve test failures for CacheKey, ORM entities, and Collection…
abnegate Mar 24, 2026
15d8eed
fix: resolve adapter test failures across all databases
abnegate Mar 24, 2026
f86a80d
fix: wrap user:x removal in try/finally and relax testGetDocumentSelect
abnegate Mar 24, 2026
6b8203f
fix: resolve cursor validation, Pool stale transforms, MySQL timeout,…
abnegate Mar 24, 2026
23fd044
fix: make test fixtures idempotent for paratest functional mode
abnegate Mar 24, 2026
a99ad70
fix: revert PermissionTests fixture and Documents.php NotFoundExcepti…
abnegate Mar 24, 2026
9815a9f
fix: use UUID collection names for paratest isolation and fix test or…
abnegate Mar 25, 2026
042aa09
fix: resolve Console class namespace, SharedTables update detection, …
abnegate Mar 25, 2026
a55ef9d
fix: narrow internal key skip list to only system-managed keys
abnegate Mar 25, 2026
9f57454
fix: use unique collection names in aggregation, relationship, and Sh…
abnegate Mar 25, 2026
94b44f9
fix: add PHPStan type annotation for createdProductCollections array
abnegate Mar 25, 2026
79eaeb4
fix: SharedTables multi-tenant cleanup and Pool timeout propagation
abnegate Mar 25, 2026
f558e40
fix: Pool setTimeout state tracking and MySQL timeout dirty flag
abnegate Mar 25, 2026
4de656f
fix: use docker stop instead of docker kill for Redis-Destructive tests
abnegate Mar 25, 2026
582d2cb
fix: reconnect cache after Redis restart in destructive tests
abnegate Mar 25, 2026
98a4fa8
fix: address review — add missing syncReadHooks in Mongo and tenant g…
abnegate Mar 25, 2026
93d3108
fix: replace slow waitForRedis polling with direct reconnect
abnegate Mar 25, 2026
be5a1f8
fix: set read_timeout on Redis reconnect and use instant docker stop
abnegate Mar 25, 2026
f08deea
fix: remove redundant testCacheReconnect, already covered by utopia-p…
abnegate Mar 25, 2026
617cf69
fix: replace docker-based Redis test with mock, remove Redis-Destruct…
abnegate Mar 25, 2026
9107f2f
Selective startup
abnegate Mar 25, 2026
ed945f0
fix: use docker-compose profiles to only start needed services per CI…
abnegate Mar 25, 2026
08c10f2
fix: keep xdebug.so in image, restore volume mount
abnegate Mar 25, 2026
2150f9b
fix: disable xdebug in CI with XDEBUG_MODE=off
abnegate Mar 25, 2026
4767099
refactor: break SQLite inheritance from MariaDB, use Feature interfaces
abnegate Mar 25, 2026
25b1fe2
fix: add relationship guards for SQLite, fix lint issues
abnegate Mar 25, 2026
9ccb3e1
fix: add remaining relationship guards, make Pool implement Features
abnegate Mar 25, 2026
13a60f0
fix: update PHPStan baseline, remove redundant instanceof checks
abnegate Mar 25, 2026
1f65132
fix: correct malformed datetime test value
abnegate Mar 25, 2026
f952c28
fix: use ISO datetime format in test, MySQL rejects text format
abnegate Mar 25, 2026
5a53446
refactor: promote shared methods from concrete adapters to SQL.php
abnegate Mar 25, 2026
476aef4
fix: align spatial method signatures, fix import ordering
abnegate Mar 25, 2026
7be2b74
feat: expose schema builder, rename BuildResult to Plan, add permissi…
abnegate Mar 26, 2026
141df88
(chore): update lock
abnegate Mar 26, 2026
a99e777
(feat): unified addHook API, Decorator/Interceptor/Permissions/Tenanc…
abnegate Mar 26, 2026
ab86d6f
(fix): remove parse error from dangling statement and inline assignme…
abnegate Mar 26, 2026
a51656c
(fix): accept any PDO-compatible object in SQL adapter constructor
abnegate Mar 26, 2026
3006ceb
(fix): use object type for PDO parameter
abnegate Mar 26, 2026
57b4d17
(fix): remove DatabasePDO type constraints from SQL adapter
abnegate Mar 26, 2026
0946667
(fix): pass PermissionType enum to getPermissionsByType
abnegate Mar 26, 2026
6a256be
(fix): pass PermissionType enum to Input constructor
abnegate Mar 26, 2026
e6d2504
(fix): handle ColumnType::Float in row size calculation
abnegate Mar 26, 2026
f51f4a5
(fix): handle ColumnType::Float everywhere alongside Double
abnegate Mar 26, 2026
5efffc0
(fix): restore syncWriteHooks auto-registration for Permissions and T…
abnegate Mar 26, 2026
c0f0c20
(fix): pass PermissionType enum to getPermissionsByType in Permission…
abnegate Mar 26, 2026
3f2e0ef
(fix): revert syncWriteHooks - manual registration only for user data…
abnegate Mar 26, 2026
d55beb5
(fix): auto-register Permissions hook in syncWriteHooks for all DB in…
abnegate Mar 27, 2026
9ad4baf
(revert): remove auto-registration, back to empty syncWriteHooks
abnegate Mar 27, 2026
be29e8e
(fix): sync write hooks from Pool adapter to inner adapter on delegate
abnegate Mar 27, 2026
ec959e3
(fix): sync write hooks from Pool only for DML operations, empty sync…
abnegate Mar 27, 2026
4f96135
(fix): normalize order case in Mongo tryFrom calls, add integer seque…
abnegate Mar 31, 2026
03f2ba5
(chore): trigger CI
abnegate Mar 31, 2026
902826b
(fix): update tests to use enum types and new hook API after refactoring
abnegate Mar 31, 2026
68dd174
(fix): pass ColumnType enum to addFormat in AttributeTests
abnegate Mar 31, 2026
7e3f9bc
(fix): restore Permissions write hook in syncWriteHooks, remove globa…
abnegate Mar 31, 2026
e1a5cea
(fix): register Permissions hook in test setUp for explicit permissio…
abnegate Mar 31, 2026
516ed26
(fix): restore Tenancy write hook registration in syncWriteHooks for …
abnegate Mar 31, 2026
5fb45e5
(fix): use direct sharedTables/tenant check in newBuilder instead of …
abnegate Mar 31, 2026
49f98ee
(fix): address PR review comments - return type safety, read hook ini…
abnegate Mar 31, 2026
076038e
Merge remote-tracking branch 'origin/main' into feat-query-lib
abnegate Mar 31, 2026
0570e1d
(fix): resolve PHPStan errors and regenerate baseline
abnegate Mar 31, 2026
3a4ded6
(refactor): collapse Hook\Relationship interface into Relationships c…
abnegate Mar 31, 2026
26f0c82
(fix): accept PermissionType or string in Input for custom permission…
abnegate Mar 31, 2026
9074dfa
(fix): remove auto-registration of hooks, let callers register explic…
abnegate Mar 31, 2026
843dce3
(fix): propagate write hooks for singular document operations in Pool…
abnegate Mar 31, 2026
146221a
(fix): propagate write hooks unconditionally in Pool, forward to Mirr…
abnegate Mar 31, 2026
2444fe6
(fix): handle millisecond timestamp strings in Mongo castingBefore
abnegate Mar 31, 2026
89e7afc
(fix): resolve Structure validator missing Float, TenantFilter alias …
abnegate Mar 31, 2026
2c3cc09
(fix): skip structure validation for internal metadata document updates
abnegate Mar 31, 2026
a32778b
(fix): include null tenant in MongoDB metadata collection queries
abnegate Mar 31, 2026
87a32dd
(fix): always call castingAfter in createDocument regardless of relat…
abnegate Mar 31, 2026
93b7f4d
(fix): add ColumnType::Float case to Attribute validator
abnegate Mar 31, 2026
84c0c74
(fix): skip decorators during silenced (internal) operations
abnegate Mar 31, 2026
c481610
(fix): convert associative arrays to Documents in relationship hooks
abnegate Mar 31, 2026
49e2dea
(fix): use loose comparison for tenant checks and fix PHPStan return …
abnegate Mar 31, 2026
ed0b48a
(fix): add PHPStan type assertions for Document constructor calls
abnegate Mar 31, 2026
a07ec0e
(fix): restore Document tenant int cast, validate relationship $id, f…
abnegate Mar 31, 2026
999c209
(fix): convert associative arrays to Documents in relationship hooks
abnegate Mar 31, 2026
c9a9c7c
(chore): trigger CI
abnegate Mar 31, 2026
fa461e5
(fix): normalize tenant types at boundary, restore strict comparison
abnegate Apr 1, 2026
cae1e99
(chore): add agent files
abnegate Apr 1, 2026
7140252
(feat): add metadata parameter to createCollection for custom attributes
abnegate Apr 2, 2026
2c49e16
(feat): add externalId attribute to collection metadata schema
abnegate Apr 2, 2026
3fade2e
Merge remote-tracking branch 'origin/main' into feat-query-lib
abnegate Apr 8, 2026
7ab1b83
(chore): resolve merge conflicts with main, keep query-lib adapter ar…
abnegate Apr 23, 2026
f720a2b
(chore): pin claude-pr-owner to v0.2.0
abnegate Apr 23, 2026
af527e1
Revert "(chore): pin claude-pr-owner to v0.2.0"
abnegate Apr 23, 2026
15e6aa7
Merge branch 'main' into feat-query-lib
abnegate Apr 23, 2026
c2b792e
(fix): address review findings — 1 HIGH, 0 MEDIUM
github-actions[bot] Apr 23, 2026
eb7fef3
Merge remote-tracking branch 'origin/main' into feat-query-lib
abnegate Apr 23, 2026
2378ab9
Merge branch 'main' into feat-query-lib
abnegate Apr 23, 2026
b6198a6
Merge remote-tracking branch 'origin/main' into feat-query-lib
abnegate Apr 24, 2026
997093a
(fix): address review findings — 1 HIGH, 0 MEDIUM
github-actions[bot] Apr 24, 2026
ca4e2a7
(fix): CI — define Query::LOGICAL_TYPES/TYPE_ELEM_MATCH, drop Databas…
github-actions[bot] Apr 24, 2026
56e3342
Merge remote-tracking branch 'origin/main' into feat-query-lib
abnegate Apr 24, 2026
6f2fc7f
(fix): address review findings — critical & warning
github-actions[bot] Apr 24, 2026
3f277c1
(fix): CI — emit INSERT IGNORE when skipDuplicates is set in SQL::cre…
github-actions[bot] Apr 24, 2026
78529fe
(fix): CI — propagate skipDuplicates through Database → Adapter → Per…
github-actions[bot] Apr 24, 2026
b44c8cd
(fix): CI — bump utopia-php/query pin to include ColumnType::Serial
github-actions[bot] Apr 24, 2026
e95c1f8
fix: rename Plan to Statement and Blueprint to Table after query lib …
abnegate Apr 29, 2026
8bfe500
fix: drop redundant Postgres TIMESTAMP qualifier and isolate join-agg…
abnegate Apr 29, 2026
2e24174
chore: bump utopia-php/query to 0.2.0
abnegate Apr 29, 2026
d8011fa
Merge branch 'main' into feat-query-lib
abnegate Apr 29, 2026
b3206a6
chore: regenerate composer.lock after merge with main
abnegate Apr 29, 2026
f8bbaae
fix: extend join-test data isolation to remaining DataProvider tests
github-actions[bot] Apr 29, 2026
1656c9c
(fix): CI — replace removed getSupportForHostname() with supports(Cap…
github-actions[bot] Apr 29, 2026
874ae86
refactor: scrub stale Blueprint/Plan terminology after query-lib rename
github-actions[bot] Apr 29, 2026
514e7e5
(fix): CI — replace removed getSupportForHostname() mock in CacheKeyTest
github-actions[bot] Apr 29, 2026
c61d31f
fix: clear PHPStan errors after merge from main
abnegate Apr 29, 2026
936b1df
perf: batch permissions read in afterDocumentBatchUpdate
abnegate Apr 29, 2026
e4e2fef
perf: cache DocumentsValidator per collection
abnegate Apr 29, 2026
800dc79
perf: hoist hot-loop guards and cache spatial / map / timeout state o…
abnegate Apr 29, 2026
e1756b5
refactor: consolidate find/count/sum binding loops into bindStatement…
abnegate Apr 29, 2026
ba8d911
perf: trim find/count/sum redundant work and parse queries once in va…
abnegate Apr 29, 2026
9b60851
fix: purge collection cache on index create/delete and revert timeout…
abnegate Apr 29, 2026
1e64e5a
fix: invalidate spatial cache on rename/updateAttribute paths
github-actions[bot] Apr 29, 2026
c87fb80
fix: route Mirror's getDocumentsValidator through source for cache co…
abnegate Apr 29, 2026
7258011
(fix): CI — purge cached DocumentsValidator on index changes
github-actions[bot] Apr 29, 2026
d3dae3b
fix: address spatial-cache scoping & per-row alloc warnings
github-actions[bot] Apr 29, 2026
e8ba8f4
Merge branch 'main' into feat-query-lib
abnegate Apr 29, 2026
d48f975
perf: stop allocating typed Attribute objects in read hot paths
abnegate Apr 29, 2026
4e96d92
style: fix pint no_whitespace_in_blank_line
abnegate Apr 29, 2026
aee3c47
fix: address review findings — cache coherence & memory parity
github-actions[bot] Apr 29, 2026
8868c66
refactor: tighten internal-attribute caches and extract isRelationshi…
github-actions[bot] Apr 29, 2026
2f2fc2f
fix(memory): exclude rows when notEqual candidates contain NULL
github-actions[bot] Apr 29, 2026
51ebe32
(fix): CI — apply MySQL session timeout eagerly to stop pool leaks
github-actions[bot] Apr 29, 2026
cac5a9a
fix(memory): reconcile adapter signatures with typed Attribute/Index/…
abnegate Apr 29, 2026
1d92a85
fix: null-guard cache key documentId and mongo object filter empty key
abnegate Apr 29, 2026
db03f79
ci: add Memory adapter to test matrix
abnegate Apr 29, 2026
72acd76
fix(memory): declare adapter capabilities and per-process test database
abnegate Apr 29, 2026
ebe9e64
test(memory): skip no-change update permission optimisation test
abnegate Apr 29, 2026
c2bda30
perf(relationships): batch N+1 single-row calls in Relationships hook
abnegate Apr 30, 2026
b663a28
perf(database): cache getInternalAttributes() and use Attribute::isRe…
abnegate Apr 30, 2026
e8cd9da
perf(adapter): cache Adapter::filter() preg_replace results
abnegate Apr 30, 2026
fc1e05e
perf(relationships): pre-index processQueries relationship lookups
abnegate Apr 30, 2026
24710a2
test: structural cache-key tenant assertion in testSetGlobalCollection
abnegate Apr 30, 2026
4ea97af
perf(adapter): cache MariaDB session timeout and add hot-path bypasses
abnegate Apr 30, 2026
b662ef9
perf(adapter): skip MariaDB timeout-set branch entirely when never armed
abnegate Apr 30, 2026
ef6b8b5
perf(adapter): defer per-query clone in SQL find to join-only path
abnegate Apr 30, 2026
775dd33
perf(relationships): fast-exit hooks when collection has no relations…
abnegate Apr 30, 2026
20c9041
perf(database): tighten decode hot path
abnegate Apr 30, 2026
18c0ca4
perf(database): skip casting for already-canonical types
abnegate Apr 30, 2026
13e4edb
perf(database): inline authorization toggle in find to avoid per-find…
abnegate Apr 30, 2026
01b0c6a
perf(database): inline events-silence toggle in find collection lookup
abnegate Apr 30, 2026
c94a5cc
fix(adapter): use per-adapter quote() in fast-path SQL strings
abnegate Apr 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
docker compose up -d --wait

- name: Run Unit Tests
run: docker compose exec tests vendor/bin/phpunit /usr/src/code/tests/unit
run: docker compose exec tests vendor/bin/paratest --configuration phpunit.xml --functional --processes 4 /usr/src/code/tests/unit

adapter_test:
name: Adapter Tests
Expand Down Expand Up @@ -103,4 +103,7 @@ jobs:
docker compose up -d --wait

- name: Run Tests
run: docker compose exec -T tests vendor/bin/phpunit /usr/src/code/tests/e2e/Adapter/${{matrix.adapter}}Test.php --debug
run: docker compose exec -T tests vendor/bin/paratest --configuration phpunit.xml --functional --processes 4 --exclude-group redis-destructive /usr/src/code/tests/e2e/Adapter/${{matrix.adapter}}Test.php

- name: Run Redis-Destructive Tests
run: docker compose exec -T tests vendor/bin/phpunit --configuration phpunit.xml --group redis-destructive /usr/src/code/tests/e2e/Adapter/${{matrix.adapter}}Test.php
25 changes: 19 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@ FROM composer:2.8 AS composer

WORKDIR /usr/local/src/

COPY composer.lock /usr/local/src/
COPY composer.json /usr/local/src/
COPY database/composer.lock /usr/local/src/
COPY database/composer.json /usr/local/src/

RUN composer install \
# Copy local query lib dependency (referenced as ../query in composer.json)
COPY query /usr/local/query

# Rewrite path repository to use copied location
RUN sed -i 's|"url": "../query"|"url": "/usr/local/query"|' /usr/local/src/composer.json \
&& sed -i 's|"symlink": true|"symlink": false|' /usr/local/src/composer.json

RUN COMPOSER_MIRROR_PATH_REPOS=1 composer install \
--ignore-platform-reqs \
--optimize-autoloader \
--no-plugins \
--no-scripts \
--prefer-dist

# Replace symlink with actual copy (composer path repos may still symlink)
RUN if [ -L /usr/local/src/vendor/utopia-php/query ]; then \
rm /usr/local/src/vendor/utopia-php/query && \
cp -r /usr/local/query /usr/local/src/vendor/utopia-php/query; \
fi

FROM php:8.4.18-cli-alpine3.22 AS compile

ENV PHP_REDIS_VERSION="6.3.0" \
Expand Down Expand Up @@ -110,9 +123,9 @@ COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20240924/redis.
COPY --from=pcov /usr/local/lib/php/extensions/no-debug-non-zts-20240924/pcov.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
COPY --from=xdebug /usr/local/lib/php/extensions/no-debug-non-zts-20240924/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/

COPY ./bin /usr/src/code/bin
COPY ./src /usr/src/code/src
COPY ./dev /usr/src/code/dev
COPY database/bin /usr/src/code/bin
COPY database/src /usr/src/code/src
COPY database/dev /usr/src/code/dev

# Add Debug Configs
RUN if [ "$DEBUG" = "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,22 +633,22 @@ $database->createRelationship(
);

// Relationship onDelete types
Database::RELATION_MUTATE_CASCADE,
Database::RELATION_MUTATE_SET_NULL,
Database::RELATION_MUTATE_RESTRICT,
ForeignKeyAction::Cascade->value,
ForeignKeyAction::SetNull->value,
ForeignKeyAction::Restrict->value,

// Update the relationship with the default reference attributes
$database->updateRelationship(
collection: 'movies',
id: 'users',
onDelete: Database::RELATION_MUTATE_CASCADE
onDelete: ForeignKeyAction::Cascade->value
);

// Update the relationship with custom reference attributes
$database->updateRelationship(
collection: 'movies',
id: 'users',
onDelete: Database::RELATION_MUTATE_CASCADE,
onDelete: ForeignKeyAction::Cascade->value,
newKey: 'movies_id',
newTwoWayKey: 'users_id',
twoWay: true
Expand Down Expand Up @@ -755,25 +755,25 @@ $database->decreaseDocumentAttribute(
// Update the value of an attribute in a document

// Set types
Document::SET_TYPE_ASSIGN, // Assign the new value directly
Document::SET_TYPE_APPEND, // Append the new value to end of the array
Document::SET_TYPE_PREPEND // Prepend the new value to start of the array
SetType::Assign, // Assign the new value directly
SetType::Append, // Append the new value to end of the array
SetType::Prepend // Prepend the new value to start of the array
Note: Using append/prepend with an attribute which is not an array, it will be set to an array containing the new value.

$document->setAttribute(key: 'name', 'Chris Smoove')
->setAttribute(key: 'age', 33, Document::SET_TYPE_ASSIGN);
->setAttribute(key: 'age', 33, SetType::Assign);

$database->updateDocument(
collection: 'users',
id: $document->getId(),
collection: 'users',
id: $document->getId(),
document: $document
);
);

// Update the permissions of a document
$document->setAttribute('$permissions', Permission::read(Role::any()), Document::SET_TYPE_APPEND)
->setAttribute('$permissions', Permission::create(Role::any()), Document::SET_TYPE_APPEND)
->setAttribute('$permissions', Permission::update(Role::any()), Document::SET_TYPE_APPEND)
->setAttribute('$permissions', Permission::delete(Role::any()), Document::SET_TYPE_APPEND)
$document->setAttribute('$permissions', Permission::read(Role::any()), SetType::Append)
->setAttribute('$permissions', Permission::create(Role::any()), SetType::Append)
->setAttribute('$permissions', Permission::update(Role::any()), SetType::Append)
->setAttribute('$permissions', Permission::delete(Role::any()), SetType::Append)

$database->updateDocument(
collection: 'users',
Expand Down
11 changes: 6 additions & 5 deletions bin/tasks/relationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Utopia\Database\Helpers\Role;
use Utopia\Database\PDO;
use Utopia\Database\Query;
use Utopia\Query\Schema\ForeignKeyAction;
use Utopia\Validator\Boolean;
use Utopia\Validator\Integer;
use Utopia\Validator\Text;
Expand Down Expand Up @@ -111,11 +112,11 @@
$database->createAttribute('categories', 'name', Database::VAR_STRING, 256, true);
$database->createAttribute('categories', 'description', Database::VAR_STRING, 1000, true);

$database->createRelationship('authors', 'articles', Database::RELATION_MANY_TO_MANY, true, onDelete: Database::RELATION_MUTATE_SET_NULL);
$database->createRelationship('articles', 'comments', Database::RELATION_ONE_TO_MANY, true, twoWayKey: 'article', onDelete: Database::RELATION_MUTATE_CASCADE);
$database->createRelationship('users', 'comments', Database::RELATION_ONE_TO_MANY, true, twoWayKey: 'user', onDelete: Database::RELATION_MUTATE_CASCADE);
$database->createRelationship('authors', 'profiles', Database::RELATION_ONE_TO_ONE, true, twoWayKey: 'author', onDelete: Database::RELATION_MUTATE_CASCADE);
$database->createRelationship('articles', 'categories', Database::RELATION_MANY_TO_ONE, true, id: 'category', twoWayKey: 'articles', onDelete: Database::RELATION_MUTATE_SET_NULL);
$database->createRelationship('authors', 'articles', Database::RELATION_MANY_TO_MANY, true, onDelete: ForeignKeyAction::SetNull->value);
$database->createRelationship('articles', 'comments', Database::RELATION_ONE_TO_MANY, true, twoWayKey: 'article', onDelete: ForeignKeyAction::Cascade->value);
$database->createRelationship('users', 'comments', Database::RELATION_ONE_TO_MANY, true, twoWayKey: 'user', onDelete: ForeignKeyAction::Cascade->value);
$database->createRelationship('authors', 'profiles', Database::RELATION_ONE_TO_ONE, true, twoWayKey: 'author', onDelete: ForeignKeyAction::Cascade->value);
$database->createRelationship('articles', 'categories', Database::RELATION_MANY_TO_ONE, true, id: 'category', twoWayKey: 'articles', onDelete: ForeignKeyAction::SetNull->value);
};

$dbAdapters = [
Expand Down
18 changes: 15 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"type": "library",
"keywords": ["php","framework", "upf", "utopia", "database"],
"license": "MIT",
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {"Utopia\\Database\\": "src/Database"}
},
Expand All @@ -25,7 +26,7 @@
],
"test": [
"Composer\\Config::disableProcessTimeout",
"docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml"
"docker compose exec tests vendor/bin/paratest --configuration phpunit.xml --functional --processes 4"
],
"lint": "php -d memory_limit=2G ./vendor/bin/pint --test",
"format": "php -d memory_limit=2G ./vendor/bin/pint",
Expand All @@ -40,11 +41,13 @@
"utopia-php/framework": "0.33.*",
"utopia-php/cache": "1.*",
"utopia-php/pools": "1.*",
"utopia-php/mongo": "1.*"
"utopia-php/mongo": "1.*",
"utopia-php/query": "@dev"
},
"require-dev": {
"fakerphp/faker": "1.23.*",
"phpunit/phpunit": "9.*",
"brianium/paratest": "^6.11",
"pcov/clobber": "2.*",
"swoole/ide-helper": "5.1.3",
"utopia-php/cli": "0.14.*",
Expand All @@ -58,6 +61,15 @@
"mongodb/mongodb": "Needed to support MongoDB Database Adapter"

},
"repositories": [
{
"type": "path",
"url": "../query",
"options": {
"symlink": true
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
],
"config": {
"allow-plugins": {
"php-http/discovery": false,
Expand Down
Loading