NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #4285 most downloaded on Packagist
A simple library to manage application persistence using multiple database adapters
Latest stable
10.1.1
Last release 11 days ago
11 Nov 2026
Ships on a steady schedule
a new release about every 8 days
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
461 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
chore(deps): pin dependencies by @renovate-appwrite[bot] in https://github.com/utopia-php/database/pull/1057
Full Changelog: https://github.com/utopia-php/database/compare/10.1.0...10.1.1
Adds Database::estimateCount(string $collection): ?int, which reads a collection's row count from engine statistics instead of scanning it.
Adds Database::estimateCount(string $collection): ?int, which reads a collection's row count from engine statistics instead of scanning it.
On Postgres it returns n_live_tup, which every commit updates. A standby collects no statistics, so it returns reltuples from the last vacuum or analyze instead. It returns null for never-analyzed or missing tables and for shared tables, whose statistics cover every tenant. Every other adapter returns null, so callers fall back to count(). Pool delegates it and ReadWritePool routes it as a read.
An exact COUNT on Postgres reads the whole heap once scattered writes clear the visibility map. On a 3M-row (3.5 GB) table, that was 3.5 GB read and 30 s of IO wait, against one block and 0.05 ms for the estimate.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Remove the temporary cache migration bridge after consumers have completed their v2 rollout.
Remove the temporary cache migration bridge after consumers have completed their v2 rollout.
Breaking API cleanup:
Utopia\Database\Cache\Bridge and legacy numeric writer bookkeeping. Mutation coordination now always uses the existing opaque-CAS protocol.Query invalidation always purges the caller-owned epoch before rotating it, including a cold local region, so semantic purge replay invalidates a warm remote region. A regression reproduced stale remote data before the fix and fresh recomputation after it.
Upgrade only after all legacy-reading processes and Jobs have exited. Replace a bridge already in v2 mode with the same namespaced cache view; preserve the exact v2: keys and CAS identities. Do not clear caches or return to legacy readers. Keep explicit v2 mode flags while old bridge images remain possible rollback targets.
Validation: full unit suite (13,141 tests, 199,561 assertions), full static analysis, multi-adapter CI, and released-v2/new-client interoperability covering warm data, invalidation in both directions, state eviction, concurrent writers and stale list fills.
No schema/data migration, extra cache service or production deployment is performed by this release. Previous tags are unchanged.
PR: https://github.com/utopia-php/database/pull/1052 Tracking: https://github.com/appwrite-labs/cloud/issues/7152
Fix application list-cache compatibility in the temporary rolling migration bridge.
Fix application list-cache compatibility in the temporary rolling migration bridge.
The existing legacy → dual → v2 rolling rollout remains unchanged. Use Appwrite's corresponding list-cache integration to rotate version markers in both keyspaces during permission writes. Normal v2 caching keeps the single CAS-version epoch and strict circuit-breaker behavior.
Validation: real Redis bridge regressions across every phase, including TTLs, batch fills, rotation and purge invalidation; full unit and multi-adapter CI. Appwrite regression coverage verifies warm list reads, available permission writes and rejection of stale list fills across mixed phases.
Follow-up to 9.1.0; previous tags remain unchanged. No database migration, separate cache instance, or production deployment is performed by this release.
Add an explicit temporary bridge for rolling migration from cache 5/database 8 to eviction-safe CAS caching on the existing Redis/Dragonfly.
Add an explicit temporary bridge for rolling migration from cache 5/database 8 to eviction-safe CAS caching on the existing Redis/Dragonfly.
Roll three passes: legacy reads with both invalidation protocols, dual (v2 reads with both protocols), then v2 only. Verify every legacy-only process and in-flight write has finished before enabling v2 reads; retire legacy readers and the rollback window before v2-only writes. No region shutdown, cache flush or extra state service is required. Preserve the isolated v2 namespace during later cleanup.
Requires stable cache ^6.1.1. It preserves ordinary legacy registrations under Cloud's fill-grace setting while conditional fills remain fenced. Documents, definitions, negative entries, queries, standalone cache regions, partial completion errors, circuit breakers and logical purge recording are covered. Query slot zero uses the same field for conditional fills and reads.
Validation: all 21 PR checks pass, and the complete unit suite passes 13,151 tests /199,715 assertions. The released cache 6.1.1 package passes 15 compatibility/eviction tests /169 assertions, with an isolated released database 8.3.15/cache 5.2.0 process sharing Redis and SQL with bridge clients.
Implementation and migration documentation. A successful post-commit invalidation remains necessary; durable replay of lost completions is separate work.
For Appwrite rolling upgrades with application list caches, use database 9.1.1 or newer. It preserves legacy batch fills and supports expiring list-marker rotation in both keyspaces.
Require utopia-php/cache ^6.0, resolved to stable 6.0.0. No development dependency or version alias is used.
Require utopia-php/cache ^6.0, resolved to stable 6.0.0. No development dependency or version alias is used.
Replace the legacy started/finished counters and owner sidecars with one atomic writer record. Its CAS version is the collection epoch. Every writer completion rotates that identity, including a writer whose registration was evicted, preserving newer live writers and retiring pre-commit fills. Query cache getGeneration() becomes getLease(). Unsupported adapters bypass coordinated database caching.
Drain and stop legacy API, worker, task and migration writers; clear disposable cached data; deploy matching cache 6.x/database 9.x libraries everywhere; then resume. Rollback requires the same cutover. No additional Dragonfly or connection DSN is required. Successful post-commit invalidation remains necessary; durable replay of lost completions is separate work.
Released from c0c72c75a5c47730759ddac169973826e0c05fd5 with all 21 PR checks passing. The complete local unit suite passes 13,140 tests and 199,561 assertions against stable cache 6.0.0; both PHPStan configurations and Pint pass. Native Redis/Dragonfly/SQLite regressions cover state eviction, stale fills and in-flight transaction completion.
Implementation: https://github.com/utopia-php/database/pull/1049 Cache release: https://github.com/utopia-php/cache/releases/tag/6.0.0
fix(cache): report a cache that refuses an invalidation as unavailable by @abnegate in https://github.com/utopia-php/database/pull/1047
Full Changelog: https://github.com/utopia-php/database/compare/8.3.14...8.3.15
fix(sql): filter dotted attribute keys in batch create and upsert by @HarshMN2345 in https://github.com/utopia-php/database/pull/1046
Full Changelog: https://github.com/utopia-php/database/compare/8.3.13...8.3.14
fix(documents): stop a cache blip from failing a write it cannot make stale by @abnegate in https://github.com/utopia-php/database/pull/1045
Full Changelog: https://github.com/utopia-php/database/compare/8.3.12...8.3.13
fix(relationships): link by the key on the written document with read permission by @HarshMN2345 in https://github.com/utopia-php/database/pull/1044
Full Changelog: https://github.com/utopia-php/database/compare/8.3.11...8.3.12
fix(documents): retry the cache invalidation a write waits on before refusing it by @abnegate in https://github.com/utopia-php/database/pull/1043
Full Changelog: https://github.com/utopia-php/database/compare/8.3.10...8.3.11
fix(documents): retire cached documents before a write the cache cannot confirm commits by @abnegate in https://github.com/utopia-php/database/pull/10
Full Changelog: https://github.com/utopia-php/database/compare/8.3.9...8.3.10
fix(documents): keep a write going when its cache owner cannot be registered by @abnegate in https://github.com/utopia-php/database/pull/1041
Full Changelog: https://github.com/utopia-php/database/compare/8.3.8...8.3.9
fix(join): keep only the newest over-long join labels per adapter by @abnegate in https://github.com/utopia-php/database/pull/1040
Full Changelog: https://github.com/utopia-php/database/compare/8.3.7...8.3.8
feat(join): accept Appwrite table IDs as join aliases by @abnegate in https://github.com/utopia-php/database/pull/1039
Full Changelog: https://github.com/utopia-php/database/compare/8.3.6...8.3.7
fix(validator): drop the stray quote from the index length message by @abnegate in https://github.com/utopia-php/database/pull/1035
Full Changelog: https://github.com/utopia-php/database/compare/8.3.5...8.3.6
fix(adapters): bind and read every double exactly so find, count, cursors and deletes agree by @abnegate in https://github.com/utopia-php/database/pul
Full Changelog: https://github.com/utopia-php/database/compare/8.3.4...8.3.5
fix(relationships): ignore relationships whose related collection was deleted by @abnegate in https://github.com/utopia-php/database/pull/1034
Full Changelog: https://github.com/utopia-php/database/compare/8.3.3...8.3.4
fix(index): read a stored index that covers a deleted attribute by @abnegate in https://github.com/utopia-php/database/pull/1033
Full Changelog: https://github.com/utopia-php/database/compare/8.3.2...8.3.3
fix(aggregate): answer bitwise aggregates signed and refuse integer sums past int64 by @abnegate in https://github.com/utopia-php/database/pull/1026
Full Changelog: https://github.com/utopia-php/database/compare/8.3.1...8.3.2
Allow utopia-php/validators ^2.0
utopia-php/validators ^2.0 (#1025)fix(aggregates): refuse a floating aggregate that overflows a double by @abnegate in https://github.com/utopia-php/database/pull/1018
Full Changelog: https://github.com/utopia-php/database/compare/8.2.1...8.3.0
chore(deps): take utopia-php/query 0.7.1 by @abnegate in https://github.com/utopia-php/database/pull/1017
Full Changelog: https://github.com/utopia-php/database/compare/8.2.0...8.2.1
feat: nested relationship queries by @abnegate in https://github.com/utopia-php/database/pull/968
Full Changelog: https://github.com/utopia-php/database/compare/8.1.4...8.2.0
8.1.4 fixes deleteDocuments() deleting documents that stopped matching its queries after they were found. It needs no code change; a custom adapter ca
8.1.4 fixes deleteDocuments() deleting documents that stopped matching its queries after they were found. It needs
no code change; a custom adapter can opt in to the fix, see
Upgrading from 8.1.3 to 8.1.4.
Adapter::deleteDocumentsMatching(Document $collection, array $sequences, array $permissionIds, array $queries): int
deletes the rows of $sequences that match every filter query in $queries, as find() is handed them, removes
the permission rows of $permissionIds but those of a row kept because it no longer matches, and returns the
number of rows deleted. It calls deleteDocuments() with the queries readable through the new protected
Adapter::deletionFilters(), so an override of deleteDocuments() still runs, on a Pool too. Memory, SQLite,
MariaDB, MySQL, PostgreSQL, MongoDB and Redis delete only the rows that match them; Pool and ReadWritePool hand
them to the pooled adapter. A custom adapter that ignores them deletes every row of $sequences, as before.deleteDocuments() deletes only the documents that still match its filters when each batch is deleted. It found a
batch and then deleted it by internal id alone, so a document another write changed in between, so that it no
longer matched (such as a presence refreshed before an expired-presence cleanup deleted it), was deleted anyway,
cascaded to its related documents, lost its permission rows, and was counted and handed to onNext. Each batch
with filters on anything but $sequence now reads its documents again, with the same queries, in the transaction
that deletes them, and deletes them with Adapter::deleteDocumentsMatching(). A document that no longer matches is
kept with its related documents and permission rows, and is neither counted, handed to onNext nor in
Event::DocumentsDelete's count. A limit counts the documents found, kept ones included, so a kept document is not
replaced by a later one. When a document changes between that read and the delete, the batch is rolled back and
tried again, and fails with Exception\Contention once the transaction's retries are spent; the batches before it
stay deleted and Event::DocumentsDelete reports them. In a transaction begun with startTransaction() the retry
runs in a savepoint, which on MySQL and MariaDB reads the transaction's snapshot again and fails the same way; a
MongoDB replica set has no savepoints, so the batch is not retried and its partial delete stays in the transaction.
Either way the caller rolls the whole transaction back and runs it again. Without transactions, as on a standalone
MongoDB server, nothing is rolled back: the documents still stored are kept and left out of the count, onNext,
the cache purges and the event, the remaining batches are deleted, a document another deleter removed meanwhile is
counted by this call, and a cascade that already ran for a kept document stays, so cascades are best-effort there.
The adapter's count is a hint: only a document of the batch still stored after the delete counts as changed, so a
custom adapter that reports a wrong count does not fail the delete. A delete without filters, or with filters only
on $sequence, runs as before.find() binds them, so it matches the rows the find matched.8.1.3 adds a hook that rewrites the queries of a read. It changes nothing for a database without one; see Upgrading from 8.1.2 to 8.1.3.
8.1.3 adds a hook that rewrites the queries of a read. It changes nothing for a database without one; see Upgrading from 8.1.2 to 8.1.3.
Hook\Queries::rewrite(Event $event, Collection $collection, array $queries): array rewrites the queries of a
read, registered with addHook() and removed with removeHook(). It is given the queries one read was given and
the definition of the collection being read, once each query is checked to be a Query and before the read checks
its queries any further: before it validates, parses or authorizes them or resolves their joins. The queries it
returns replace the read's queries for the rest of the read, the query-cache key included. It runs for
getDocument() (Event::DocumentRead), find() and so findOne(), cursor() and resolveCursor()
(Event::DocumentFind), count() (Event::DocumentCount), sum() (Event::DocumentSum) and aggregate()
(Event::DocumentAggregate). Hooks run in registration order, each given the previous one's output. Throwing
refuses the read, with the exception reaching the caller unchanged before anything is read. It also runs on the
reads such a read makes itself: relationship population, the reads that resolve queries on relationship attributes,
findOne() through find(), each cursor() page and resolveCursor()'s read of the joined row it pairs with the
document. So it must return the same queries when given its own output; it runs whether or not events are silenced.
It never runs for reads of Database::METADATA, for the query(), mutate() and from() builders, or for writes
and the reads they make themselves. The writes are createDocument(), createDocuments(), updateDocument(),
updateDocuments(), upsertDocument(), upsertDocuments(), increaseDocumentAttribute(),
decreaseDocumentAttribute(), deleteDocument() and deleteDocuments(), and the authorizeCreate(),
authorizeUpdate() and authorizeGrants() checks of a later write; their own reads load the documents they change,
read back the ones they wrote, populate the relationships of the documents they return, and check, link and cascade
related documents, so a hook that hides rows never hides them from a write's permission and relationship checks. A
read the caller's own code makes while a write runs, such as in an onNext callback, runs it. With such a hook
registered, cursor() resolves the collection and rewrites its queries when it is called, so a missing collection
or a refusal throws then instead of when the generator is iterated. A Mirror runs it once on each of its own reads
and never on its destination's. One that is also a Hook\Lifecycle is registered on the source too, as every
lifecycle hook is, so it also rewrites the reads made on the source directly, except the reads the mirror's writes
make there.8.1.2 removes public API that nothing outside the library needed, replaces the opt-in emulation of 7.4.1's fractional arithmetic on integer attributes
8.1.2 removes public API that nothing outside the library needed, replaces the opt-in emulation of 7.4.1's fractional arithmetic on integer attributes with one rounding rule that always applies, and moves the update models into the namespace of the model they update. Every entry under Removed and Changed (breaking) needs a code change; see Upgrading from 8.1.1 to 8.1.2 for each replacement.
Database::read(), added in 8.1.0. Call find() for documents and aggregate() for aggregate or groupBy()
queries; Query::groupByType($queries)->isAggregation() tells which of the two a list is. find() still refuses
aggregate and groupBy() queries.Database::rawQuery(). Use Database::query(new Utopia\Query\Builder\Statement($query, $bindings)), which runs
the same statement under the same authorization guard. Feature\RawQuery and the adapters' rawQuery() stay.Database::getRelationshipHook(). Keep the Hook\Relationships given to addHook().Database::getMaxIndexLength(), getMaxVarcharLength(), getMinDateTime() and getMaxDateTime(). Read
indexLength, varchar, minDateTime and maxDateTime from $database->getAdapter()->limits().Database::getCacheWriterTimeout().Database::setRoundFractions(), isRoundingFractions() and withRoundFractions(), with the Mirror overrides.
Integer rounding is always on (listed under Changed).Adapter::arithmetic() and its overrides in Postgres, Mongo, SQLite, Memory, Redis and Pool;
ReadWritePool no longer lists it among the methods it answers wherever reads go.Utopia\Database\Arithmetic, Utopia\Database\Arithmetic\Rounding and the internal Arithmetic\Decimal and
Arithmetic\Fractional.bool $fractions argument of Validator\Operator and Validator\Structure (and so
Validator\PartialStructure).bool $roundFractions argument of the State\Snapshot constructor.Event\Permission\Created, Read and Deleted, which Database never dispatched. Event::PermissionsCreate,
PermissionsRead and PermissionsDelete stay as statement labels; their domain() is null.Adapter\SQL\Hook\Permission\AllowNullUid. Use Adapter\SQL\Hook\Column\AllowNull, which it wrapped.The update models moved into the namespace of the model they update. Replace the imports:
| 8.1.1 | 8.1.2 |
|---|---|
Utopia\Database\AttributeUpdate |
Utopia\Database\Attribute\Update |
Utopia\Database\CollectionUpdate |
Utopia\Database\Collection\Update |
Utopia\Database\RelationshipUpdate |
Utopia\Database\Relationship\Update |
Their constructors and fields are unchanged.
increaseDocumentAttribute() and decreaseDocumentAttribute()
round a fractional change half away from zero (1.5 adds 2, 2.5 subtracts 3), floor a fractional max and ceil a
fractional min; Operator::increment() and Operator::decrement() given to updateDocument(),
updateDocuments(), upsertDocument() and upsertDocuments() round their amount and limit the same way, so
increment(-2.5) subtracts 3. Rounding happens once, in PHP, before validation and on every adapter alike. Decimal
text, which is what is_numeric() accepts without an exponent, such as '9007199254740993.5', ' +.5' or '1.',
is rounded exactly at any size; text with an exponent is refused. A change that rounds to 0, such as 0.4, changes
nothing and skips the max or min check: a counter writes nothing and fires no event, and an operator is dropped
from the update, so updateDocuments() with nothing else to change returns 0. Before, these were refused, unless
setRoundFractions(true) stored what the adapter's engine stored on 7.4.1.Exception\Structure, as in 8.0.3 and in 8.1.1 without setRoundFractions(true): a fractional amount
or limit of multiply(), divide(), modulo() or power() on an integer attribute, and a fractional item added to
an integer array. setRoundFractions(true) resolved the operators and cut the array items toward zero. Float and
double attributes are unchanged.Adapter\Pool::getPool(): Utopia\Pools\Pool returns the pool of adapters the handle borrows from.Adapter\Pool::hostname() returns the hostname given to setHostname() when it is not empty, and asks the pooled
adapter only otherwise. 8.1.1 ignored it, so Database::getHostname() and the cache keys built from it named the
pooled adapter's host instead. ReadWritePool also follows a hostname set after its first answer.Database::authorizeGrants(string $collection, Document $document, ?callable $resolve = null): void runs only the grant check of authorizeCreate() and
Database::authorizeGrants(string $collection, Document $document, ?callable $resolve = null): void runs only the
grant check of authorizeCreate() and authorizeUpdate(), and writes nothing. It refuses a related document given
as a document that adds a permission for a role the caller does not hold, with the same Exception\Authorization
(Permissions must be one of: (<roles>)), and malformed permissions with the same Exception\Structure. Related
documents are first prepared by the Hook\Nested hooks, and $resolve gives their staged view, as for
authorizeCreate(). It checks no create or update permission on the collection, the document or any related
collection or document, so a caller can report an unheld grant before those checks, such as for a staged upsert.
$document is the document or the changes a later write would be given. It does nothing, and reads nothing, unless
grants are checked (setCheckGrants(true)), authorization is enabled and the relationship hook is attached and
enabled; while they are, a missing collection throws Exception\NotFound.fix(operators): reject operators on encrypted attributes by @HarshMN2345 in https://github.com/utopia-php/database/pull/1011
Full Changelog: https://github.com/utopia-php/database/compare/8.0.3...8.1.0
8.1.0 adds opt-in and additive APIs for work that callers had to do themselves. With no Hook\Nested hook registered
and with setCheckGrants() and setRoundFractions() off, which is the default, a Database behaves exactly as in
8.0.3, except that it runs a join on the parent side of a one-to-many relationship attribute, which 8.0.3 refused
(listed under Changed). See Upgrading from 8.0 to 8.1.
Utopia\Database\Hook\Nested, a hook with prepare(Document $collection, Document $document): Document. Register
it with Database::addHook() and remove it with removeHook(). It is given a copy of each related document that
createDocument(), createDocuments(), updateDocument(), upsertDocument(), upsertDocuments(),
authorizeCreate() or authorizeUpdate() is given as a document, at every depth the write relates. A parent is
prepared before its children, and hooks run in the order they were registered. The write checks grants on, and
relates, the document the hook returns. The hook is not given the top-level document, a related document given as
an ID, or anything from updateDocuments(). A Mirror runs it on itself, for the pre-checks, and on its source.
Its destination receives the IDs the source wrote.Database::setCheckGrants(bool $check): static, isCheckingGrants(): bool and
withCheckGrants(bool $check, callable $callback): mixed, off by default. While on and while authorization is
enabled, a related document given as a document to createDocument(), createDocuments(), updateDocument(),
upsertDocument(), upsertDocuments(), authorizeCreate() or authorizeUpdate() may add permissions only for
roles the caller holds. The check judges the document the Hook\Nested hooks return. A related document whose
$id a Hook\Nested hook assigned is judged new: none of its permissions are read or locked, and it needs create
permission. An unheld role throws Exception\Authorization (Permissions must be one of: (<roles>)) and malformed
permissions throw Exception\Structure, before anything is written.updateDocuments() refuses a related document given as a document with
Exception\Relationship (Invalid relationship value. A bulk update takes related documents by ID while grants are checked.). Related documents given by ID still link.Database::setRoundFractions(bool $round): static, isRoundingFractions(): bool and
withRoundFractions(bool $round, callable $callback): mixed, off by default. While on, a fractional change, amount
or limit on a single-valued integer or big integer attribute is stored as the adapter's engine stored it on 7.4.1,
instead of being refused. This covers increaseDocumentAttribute(), decreaseDocumentAttribute() and the numeric
operators of updateDocument(), updateDocuments(), upsertDocument() and upsertDocuments(). Fractional items
added to an integer array are cut toward zero. What the engine refused is still refused.Adapter::arithmetic(): Arithmetic declares how the adapter's engine stored a fractional result in an integer
column on 7.4.1. The base answer is MariaDB's and MySQL's. Postgres, Mongo, SQLite, Memory and Redis
override it. Pool asks the pooled adapter once per pool, and ReadWritePool answers it wherever reads go, without
opening the sticky window.Utopia\Database\Arithmetic, a final readonly class:
new Arithmetic(Rounding $counter, Rounding $operators, Rounding $division, Rounding $power, bool $refusesCounterFractions = false, array $exactOperators = [], array $refusedWithoutLimit = [], bool $truncatesModulus = false), and rounding(OperatorType $method, bool $whole): Rounding.Utopia\Database\Arithmetic\Rounding, an enum with the cases HalfEven, HalfAwayFromZero and TowardZero, and
the methods apply(int|string $base, float $fraction): int|string, round(float $value): int|string and
ratio(int|string $numerator, int|string $denominator): int|string.Validator\Operator and Validator\Structure (and so Validator\PartialStructure) take a trailing
bool $fractions = false. When it is set, a numeric operator on an integer attribute may carry a finite fractional
amount or limit within the attribute's range, for a caller that resolves it into a whole one before writing.Database::resolveCursor(string $collection, string $id, CursorDirection $direction, array $queries = []): Document returns the cursor that a list with $queries pages from when it names a document by ID. The document is
read with authorization skipped, and only the cursor fields are returned: $id, $sequence, $collection and
the values the list orders by, including values from joined rows. Pass the result only to cursorAfter() or
cursorBefore(). It returns an empty Document when no document has the ID.Database::read(string $collection, array $queries = [], PermissionType $forPermission = PermissionType::Read): array returns a list of Document. For aggregate or groupBy() queries these are the rows of aggregate();
otherwise they are what find() returns. Aggregate queries under a permission other than read throw
Exception\Query. find() still refuses aggregate queries.ParsedQuery::isAggregation(): bool tells whether the queries aggregate or group.State\Snapshot constructor takes two more trailing arguments, bool $checkGrants = false and
bool $roundFractions = false. Database::snapshot() fills them in.Query::on('orders', '$id'), compares the main $id with the relationship's two-way key in the joined
collection. The condition keeps its operator. getDocument(), find(), findOne(), read(), aggregate(),
count(), sum() and resolveCursor() run it; 8.0.3 refused it with Cannot join on virtual relationship attribute. The joined collection is read under the same permission and tenant rules as any join. The child side of
a one-to-many and every other relationship type join, or are refused, as before.Database::authorizeCreate() and Database::authorizeUpdate() take an optional resolver, ?callable $resolve = null, so a write staged after other writes
Database::authorizeCreate() and Database::authorizeUpdate() take an optional resolver,
?callable $resolve = null, so a write staged after other writes is judged as it will run, after them.
$resolve(string $collection, string $id): ?Document returns a related document as the earlier staged writes leave
it: the document with its permissions (whether or not the caller can read it), an empty Document when they delete
it, or null when they leave it as stored. Every related-document lookup of the checks uses it: a document staged
for deletion is new to the write and needs create on its collection, a staged update or create is judged by its
staged permissions and links, and a null answer reads the stored document as before. Without $resolve the
checks are unchanged, and they still write nothing.Full Changelog: https://github.com/utopia-php/database/compare/8.0.2...8.0.3
8.0.1 reverted six deliberate 8.0.0 changes as if they were regressions. 8.0.2 brings them back; everything else in 8.0.1 stays.
8.0.1 reverted six deliberate 8.0.0 changes as if they were regressions. 8.0.2 brings them back; everything else in 8.0.1 stays.
search('title', '"foo bar"')) matches the adjacent phrase again, as on MariaDB,
MySQL, SQLite, MongoDB, Memory and Redis, and notSearch() with an exact term excludes only that phrase. 8.0.1
reverted it to every word in any order by mistake. Words in a search term are still split on every character
other than a letter, a number or an underscore, as in 7.x (foo/bar and foo,bar search foo and bar).increaseDocumentAttribute() and decreaseDocumentAttribute() refuse a fractional change value, max or min
on an integer attribute with Exception\Type again, before anything is written, and a change value of 0 or less
throws Exception\Type (Value must be numeric and greater than 0) again, which catch (DatabaseException)
catches. 8.0.1 passed fractional values to the engine (rounded on MariaDB and MySQL, truncated on MongoDB, an
error on PostgreSQL) and threw \InvalidArgumentException by mistake.max or min limit with Exception\Structure again,
as 8.0.0 did. Numeric text such as power('2') stays accepted. 8.0.1 accepted fractional limits by mistake.UID validator description names every character it accepts again (a-z, A-Z, 0-9, period, hyphen, and underscore, none of the last three leading). 8.0.1 returned 7.x's text, which leaves out periods and hyphens.document_purge fires after the outermost transaction commits again, and never for a write that rolled back.
The cache entry is still purged inside the write's transaction, so a cache failure rolls the write back. 8.0.1
fired the event just before the commit by mistake.Full Changelog: https://github.com/utopia-php/database/compare/8.0.1...8.0.2
8.0.1 restores the 7.4.1 behaviour that 8.0.0 changed for callers of features 7.x already had. New 8.0 features are unchanged. It also holds nested re
8.0.1 restores the 7.4.1 behaviour that 8.0.0 changed for callers of features 7.x already had. New 8.0 features are unchanged. It also holds nested relationship links to the permission rule UPGRADE.md states.
Database::authorizeCreate(string $collection, Document $document) and Database::authorizeUpdate(string $collection, Document $old, Document $document) run the permission checks of a later createDocument() or
updateDocument() without writing: create on the collection (update on the document for an update, document-level
under document security) and, when the relationship hook is attached and enabled, every nested related document
as deep as the write relates it. They throw Exception\Authorization with the reason the write would give. Use
them to refuse a write you stage to run later, such as a transaction operation, when it is staged.and(), or() and elemMatch() are validated before
the query itself, the first invalid query in reading order sets the message even when a later one does not parse,
a method 7.x could not parse that no validator takes reads Invalid query: Invalid query method: <method>, and a
raw query from a string reads Invalid query method: raw.select('$tenant') passes query validation again without shared tables, and the read refuses it with Cannot select attributes: $tenant, as in 7.x.UID validator description is the 7.x text again, also inside Invalid cursor: …."foo bar") matches every word in any order again, not the adjacent phrase.containsAll() on an attribute that is not an array matches each value as a whole-value LIKE (ILIKE on
PostgreSQL) pattern, any of them, on MariaDB, MySQL and PostgreSQL, as in 7.x.orderRandom() ignores its cursor instead of failing with Order attribute '' is empty.document_purge fires inside the write's outermost transaction, just before it commits, so a listener that throws
rolls the write back and its failure reaches the caller, as in 7.x.increaseDocumentAttribute() and decreaseDocumentAttribute() pass a fractional change, max or min on an
integer attribute to the engine again and return the exact sum, and refuse a change that is not above zero with
\InvalidArgumentException, as in 7.x.Default value x does not match given type <type> (and is not a valid integer string for type bigint) without JSON quoting, as in 7.x.Index::fromArray() refuses an unknown index type with Exception\Index (Unknown index type: …) instead of
creating a key index.Exception\Unique::MESSAGE is Unique index violation again.key
index_<key>, is read under its $id _index_<key>.find(), as PHP writes them elsewhere, so a write
no longer stores 1e-300 or -2.5e-20 as 0.author.profile.*, tags.books.name) return the related documents' attributes
as in 7.x, and select(['*', '*.*']) reads every column instead of failing on MariaDB, MySQL and PostgreSQL.$sequence ahead of $id, in 7.x's key order, on every adapter.$updatedAt, as 7.x did; unlinking still stamps the child.Exception\Authorization: with the
read check's reason when it is given by ID, with the update check's reason (or the read check's when the caller may
update) when it is given as a document. 8.0.0 left a half link to it (one-to-one, many-to-one), dropped it
silently (one-to-many, many-to-many) or tried to create it, failing with Exception\Duplicate.Full Changelog: https://github.com/utopia-php/database/compare/8.0.0...8.0.1
feat: nested join ON queries by @abnegate in https://github.com/utopia-php/database/pull/942
Full Changelog: https://github.com/utopia-php/database/compare/7.4.1...8.0.0
8.0 is a major release. Read UPGRADE.md before you upgrade from 7.x: it lists every change you may have to make, with the 7.x and 8.0 forms side by side.
Database registers neither on its own: add
Hook\Permissions and Hook\Relationships with addHook(). See
Register the permission and relationship hooks.Database, Query, Operator and Document are replaced by enums, and the methods that
took or returned those strings take or return enum cases. Query::getMethod() returns a Utopia\Query\Method
case, so a comparison with a string is always false. See
Constants are now enums and Queries.Helpers\ID, Helpers\Permission and Helpers\Role are Utopia\Database\Id, Permission and Role;
Mirroring\Filter is Mirror\Filter; several validators moved. No aliases are kept. See
Namespaces.createCollection(Collection),
createAttribute(string, Attribute), createIndex(string, Index), createRelationship(string, Relationship), and
updateAttribute(), updateCollection() and updateRelationship() take AttributeUpdate, CollectionUpdate and
RelationshipUpdate. Attribute, Index and Relationship are final readonly with private constructors and a
factory per type; Collection::create() builds a collection. getCollection() throws Exception\NotFound for a
missing collection, and findCollection() returns null. updateAttributeRequired(), updateAttributeFormat(),
updateAttributeFormatOptions(), updateAttributeFilters() and updateAttributeDefault() are removed. See
Schema: value objects.signed: false; integer size 0 or 8; boolean, double
and id size: 0; strings signed: true), fulltext and TTL indexes store no orders, fulltext indexes no
lengths, and an index other than TTL no longer stores ttl: 1. Attribute::fromDocument() and
Index::fromDocument() read 7.x metadata with the same normalisation, so a legacy attribute or index equals the
one 8.0 creates.uuid7 included) or a stored relationship onDelete of setDefault or
noAction makes its collection unreadable until the metadata row is repaired. See
Stored metadata.Database::on(), Database::before(), Mirror::on(), Adapter::before() and the Database::EVENT_* constants
are removed: register Hook\Lifecycle and Hook\Transform hooks with Database::addHook(). A lifecycle hook
receives one typed event object per event (handle(Event\Domain $event)). See
Lifecycle events are hooks.onNext(Document $document, ?Document $previous) callback and no $onError;
Database::BATCH_SIZE replaces INSERT_BATCH_SIZE and DELETE_BATCH_SIZE, and a larger batch size throws
Exception\Limit. upsertDocumentsWithIncrease() is upsertDocuments(..., increase:). iterate() and
foreach() are removed: cursor(), where limit() caps the total. find() refuses aggregate and groupBy()
queries: use aggregate(). See Bulk writes and reads.set<Noun>(bool) with an is/has reader: setValidation(), setFiltering(),
setLocks(), isPreservingDates(), hasSharedTables(), ignoreDuplicates() and the others replace
enableValidation(), disableValidation(), enableFilters(), disableFilters(), enableLocks(),
getPreserveDates(), getSharedTables() and skipDuplicates(). See
Configuration toggles.Filter\Codec objects: the Database constructor takes a list of them instead of an
associative array. See Filters.Adapter::getSupportFor*() methods are removed: check supports(Capability::...) or
hasFeature(Feature\...::class). The 16 per-limit getters are Adapter::limits(), an Adapter\Limits value,
and Database::profile() snapshots limits, capabilities and features for the validators. The mandatory adapter
contract is the abstract methods of Adapter; Adapter\Feature holds the optional features only.
Adapter\SQLite extends Adapter\SQL instead of Adapter\MariaDB. See Adapters.Document::getRead(), getCreate(), getUpdate(), getDelete(), getWrite(), find(), findAndReplace() and
findAndRemove() are removed, and getArrayCopy() takes no arguments: use getPermissionsByType(), only() and
except().Exception\Order and Exception\Operator extend Exception\Query, so a catch (Exception\Query) also catches
them. See Errors.Adapter\Profile. Every validator's isValid()
takes mixed $value, so a named argument permissions:, roles:, document: or input: is value:. See
Validators and helpers.Exception\Unique has the message Document with the requested unique attributes already exists on every
adapter (was Unique index violation). On MariaDB and MySQL an unknown column throws Exception\NotFound.
Database::sum() throws Exception\Query for an attribute that is not a single number. See
Errors.Query::DEFAULT_ALIAS is table_main (was main), Query::groupByType() returns a Utopia\Database\ParsedQuery
object (with orderAttributes and orderTypes, throwing Exception\Query for a cursor that is not a document),
and Query::TYPE_ELEM_MATCH is removed.new Document() and Document::setAttribute('$permissions', ...) reject non-string permissions with
Exception\Structure.\Error always reaches the caller, an isolated
failure no longer skips the other hooks, and document_purge from updateDocument() and deleteDocument() fires
after the write's transaction commits. See Hook failures.createDocuments() under ignoreDuplicates() no longer counts skipped documents or passes them to onNext, on
every adapter.increaseDocumentAttribute() and decreaseDocumentAttribute() refuse a fractional change value or a fractional
max/min on an integer attribute with Exception\Type, and the numeric operators refuse a fractional limit on
an integer attribute with Exception\Structure, before anything is written. Both accept the same whole-number
forms (for example 5, '5', '5.0' and 5.0). See Documents.Authorization::skip(), silent(), skipRelationships(), withTenant() and the other scoped
toggles apply to the calling coroutine and the coroutines it starts, not to other coroutines sharing the handle.
See Coroutines.Mirror::onError() callbacks receive a Mirror\Failure. See Mirror.Adapter\Pool extension points renamed: syncBorrowed(), releaseBorrowed(), hostname() and $arguments.
See Pool extension points.Query::join($collection, $alias, $on), leftJoin(), rightJoin() and fullOuterJoin() with a list
of Query::on() conditions and filters, and crossJoin($collection, $alias), on the SQL adapters
(Capability::Joins), in find(), count(), sum() and getDocument().
find() on it would be: every row with a collection-level
grant, the rows the caller holds document-level read on under document security, and
Exception\Authorization otherwise. Adding a join never changes which main-collection rows are visible.Too many joins: at most 8 are allowed), with or without validation
(skipValidation()).Query::DEFAULT_ALIAS and from the key of a relationship attribute of the main collection; anything else throws
Exception\Query. A join alias may use any letter case or be a reserved word.$id
and attributes as alias.$id and alias.attribute. The joined collection's internal attributes ($tenant,
$permissions, $sequence, $createdAt, $updatedAt) and its relationship attributes that hold a column (the
side that stores the related document's id) are returned only when a select names them, or, for the internal
attributes other than $tenant, when the select names alias.* or the read orders by them. Joined values are
never returned under a bare attribute name.select('alias.*'), alone or next to other selects, returns the joined row as a direct read of the joined
collection returns it: its $id, $sequence, $createdAt, $updatedAt, $permissions and attributes, but not
its $tenant. Joined columns named next to * (select(['*', 'alias.$createdAt'])) are returned with
everything * returns. An order may name a joined attribute by its bare name when only one join's collection
declares it and the main collection does not; a name several joins declare throws Exception\Query.select('alias.attribute') alike. A
decode filter receives a document built from the joined row: $id, $collection and the joined attributes the
query returned ($sequence and the other internal attributes only when the query returns them). When an outer
join matches no row, its attributes are null, whether or not the select names alias.$id (outside distinct()
reads, which select only what they name). A cursor taken from a joined result can be passed back with
cursorAfter() or cursorBefore(): its joined values are encoded with the joined collection's filters.alias.column) must be valid on the joined collection for the query type it is
used in: an attribute the joined collection declares, or an internal attribute the query type accepts on the
main collection (alias.$permissions can be selected but not filtered or ordered by, and alias.$collection is
never accepted). Otherwise Exception\Query is thrown. This applies to find(), count(), sum() and to the
join conditions and selects of getDocument().Query::on($left, $right) the left column belongs to the main collection or to a join declared before it, the right one to
the joined collection. An unknown column, a relationship side that holds no column, or a join named before it is
declared throws Exception\Query.on() conditions and plain filters (comparisons, ranges, null checks, contains,
containsAny, notContains, starts/ends-with, and and()/or() of them); anything else throws
Exception\Query (Unsupported join ON condition: <method>) in find(), count(), sum() and getDocument().cursor()
over a joined read whose rows lack such a value throws before yielding a row instead of after the first batch. getDocument() with a join pairs the lowest-sequence joined row. See
Paging a joined read.groupBy() refers to the main collection's attribute
when the main collection declares it, else to the attribute of the one joined collection that declares it. A
name no collection declares, or that more than one join declares, throws Exception\Query; qualify it with the
join alias (alias.attribute).search() and notSearch() on a joined attribute require a fulltext index on that attribute of the joined
collection. An encrypted attribute of a joined collection cannot be filtered.UNION ALL. They accept one full outer
join per query, and a right join after it has to join on a table joined before the full outer join or on the full
outer joined table (directly or through other joins); other chains throw Exception\Query. PostgreSQL runs full
outer joins natively and has no such limit. A full outer join combined with a right join reads, under shared
tables, what a dedicated database reads.groupBy(), having(), distinct(), ordering and paging over a full
outer join apply once to the whole joined result, exactly as PostgreSQL's native full outer join does. On these
engines a distinct() query over a full outer join can only be ordered by selected attributes; any other order
throws Exception\Query. Full outer joins on these engines are ordered through internal columns that never
appear in results, so every attribute and join alias reads back unchanged.updateDocuments() and deleteDocuments() reject join queries.Validator\Queries\Documents or Validator\Queries\Document you build yourself accepts joins and
aggregations as the Adapter\Profile it is given allows (Capability::Joins, Capability::Aggregations).
Validator\Queries\Base::setJoinedCollections() gives a query validator you build yourself the collections its
query sets may join. Without it, bare joined attribute names and searches on a join alias are rejected.Query::count(), countDistinct(), sum(), avg(), min(), max(), the statistical
aggregates (stddev(), stddevPop(), stddevSamp(), variance(), varPop(), varSamp()), the bitwise
aggregates (bitAnd(), bitOr(), bitXor()), groupBy() and having(), through
Database::aggregate($collection, $queries) on the SQL adapters (Capability::Aggregations). It returns a list of
rows (arrays), names an unaliased aggregate <method>_<attribute> (<method> for count('*')) and fires
document_aggregate.
groupBy()), a select may name only the attributes the query
groups by. Any other selected attribute throws Exception\Query, including $collection, $tenant unless it is
grouped, a related document's attribute and a join alias's alias.*. * and relationship wildcards at any depth
(key.*, parent.child.*) are accepted and ignored: the rows hold the groups and the aggregates only. A join
alias cannot equal a relationship key of the main collection, so key.* is always the relationship's wildcard.
This applies to aggregate(), count() and sum().having() conditions follow the filter rules: they compare aggregate aliases or groupBy attributes only,
aliases at the top level, and the fulltext and value-count rules apply inside them.sum, avg, stddev*, variance and var* require a numeric, non-array attribute, bitAnd, bitOr and
bitXor an integer one, and min and max one whose values are ordered (not an array, object, boolean, spatial
or vector attribute), on joined collections too. Only count accepts *. Aggregates and groupBy() refuse a
relationship side that holds no column.Database::sum() resolves a bare attribute name as find() does: the main collection's attribute, else the one
join that declares it.groupBy(['name', 'note.name']) returns name and note.name); a joined group alone keeps its bare name.count and countDistinct return 0 and every other aggregate returns null, on every
engine.aggregate() rejects those aggregates there with
Exception\Query. Aggregate aliases are identifiers of at most 63 characters,
and an alias cannot repeat another aggregate's alias or the name a grouped attribute is returned under.note.$id, note.$createdAt, ...) can be grouped by. $collection is
never aggregated or grouped by, and $tenant (on the main collection or under an alias) only under shared
tables. An aggregate over a main attribute named like its own alias reads the main table when a joined
collection declares the same attribute.Query::distinct() on the SQL adapters. A distinct read is ordered, and paged by a cursor, along its explicit
orders only; a search() and a vector query filter it without ordering it, and its rows carry no $distance. On
PostgreSQL and MySQL a distinct() query ordered by an unselected attribute throws Exception\Query. A distinct
row has no $id, so a cursor pages a distinct read by its order values: the read needs a select() of named
attributes and an order on each of them, or it throws Exception\Query.Database::from($collection) returns a utopia-php/query builder over a collection's table,
Database::query() runs a built read and returns a list of Document, Database::mutate() runs a built write and
returns the affected row count, and Database::schema() returns a schema builder. from(), query() and
mutate() check no permissions, bypass the caches, run no hooks and throw Exception\Authorization unless
authorization is disabled. Under shared tables every statement a from() builder runs stays within the tenant
selected when it was handed out. from($collection, $alias) names the main table by the alias. A SQL adapter's
builder() (Feature\QueryBuilder) is the builder from() builds on: its from() and its joins take collection
ids, and once it has read a collection it reads that one only, refusing fromTable(), into(), another alias
and the multi-table writes (updateJoin(), deleteJoin(), updateFrom(), deleteUsing()), whose second table
its tenant scope does not reach.find() query cache. Database::setQueryCache(new Cache\Query($cache)) caches find() results per
hostname, database, namespace, tenant and collection, and writes through the Database invalidate only the scopes
they write in: under shared tables with tenant-per-document, the scope of each written document's tenant.
Collection listings are never cached. A cache hit costs 3 cache round trips.Database::addHook() registers Hook\Lifecycle (side effects on events), Hook\Decorator (modifies
the documents a read or write returns), Hook\Transform (rewrites SQL before it runs; removeTransform() removes
one), Hook\Write (rows of its own for each document write, such as Hook\Permissions), Hook\Relationships and
Cache\Invalidator, and throws for any other hook. removeHook() unregisters a hook or every hook of a class. A
hook implementing Hook\Attachable receives the database in attach(), so new Relationships() takes no
database. A lifecycle hook that also implements Hook\Named replaces the hook registered under the same name, and
one that implements Hook\Selective receives only the events its handles() accepts.Hook\Lifecycle::handle(Event\Domain $event) receives one final readonly event object per
event, under Event\{Database,Collection,Attribute,Index,Document,Permission}, with a typed payload; bulk writes
are Event\Document\BatchCreated, BatchUpdated, BatchDeleted and BatchUpserted with their count (and
created/updated for upserts). New events: database_update, document_upsert, document_aggregate,
attribute_rename and indexes_create. An event object is built only when a registered hook handles its event.
Event\DispatcherHook forwards them to listeners per event class and to a PSR-14 dispatcher.Attribute, Index and Relationship are final readonly, built by one factory per type
(Attribute::string(), Attribute::integer(width: IntegerWidth::Bits64), Index::key(), Index::ttl(),
Relationship::oneToMany(), ...), with fromDocument()/toDocument() for storage and apply()/with*() for
changed copies. Collection::create() builds a collection, whose attributes() and indexes() return typed lists.
AttributeUpdate, CollectionUpdate and RelationshipUpdate describe sparse updates (Unchanged::Value keeps a
default or format). Format holds a format name and its options. Attribute::TYPES lists the storable column
types and Attribute::availableTypes(Adapter\Profile) narrows it to an adapter. Attribute::storedType() and
typeFromStored() convert between ColumnType cases and stored type strings. A float attribute type
(ColumnType::Float) joins double.findCollection(), collectionExists(), createIndexes() (validates every index, writes the
definition once), Database::update() (renames a database on every adapter), internalAttributes() and
collectionDefinition(): Collection. The create and update methods return the stored value object.
getSchemaAttributes() and getSchemaIndexes() return Schema\Column and Schema\Index values, and PostgreSQL
introspects its schema (Capability::SchemaIntrospection, with MariaDB, MySQL and SQLite).Utopia\Database\Event, PermissionType, RelationshipType, RelationshipSide,
RelationshipDeleteAction, SetType, OperatorType, Filter, IntegerWidth, Unchanged and Capability, and
from utopia-php/query Method, ColumnType, IndexType, OrderDirection and CursorDirection.Adapter::supports(Capability), capabilities() and hasFeature(); the optional
Adapter\Feature interfaces Casting, Connection, QueryBuilder, RawQuery, Relationships, Schemaless,
Spatial, Timeouts and Upserts; Adapter::limits() (Adapter\Limits) and Database::profile()
(Adapter\Profile); Database::setSchemaless(); Database::getHostname(). Adapter::relaxAttributeRequired() and
the protected Adapter\SQL::getSpatialColumnSrid(): ?int (the SRID written into spatial column definitions, or
null for a dialect that cannot declare one, such as MariaDB).Filter\Codec (name(), encode(), decode()), Filter\Callback and Filter\Registry. The
Database constructor takes a list of codecs, and setFilters(Filter\Registry) gives a handle a registry several
handles can share. A codec applies only to those handles and takes precedence over a global filter of the same
name (Database::addFilter()); the constructor's codecs take precedence over both. A codec named after a built-in
filter throws Exception\Duplicate. Document and query cache keys include each registered codec, by class, or by
signature() for a Filter\Signed codec such as Filter\Callback.Adapter\ReadWritePool. Sends reads to a read pool and writes to a write pool. Reads stay on the primary for a
sticky window after a write or a transaction commits (setStickyDuration(), default 5000 ms; setSticky()), and
getDocument(..., forUpdate: true) and rawQuery() always use the write pool. Metadata and configuration calls
never re-open the window, and hostname() always names the write pool's host.Database::setProfiling(), isProfiling() and getProfiler() with
Utopia\Database\Profiler, which keeps the newest Profiler::DEFAULT_CAPACITY (1000) entries (setCapacity(),
getCapacity()); getQueryCount() and getTotalTime() cover every query since the last reset(). Pooled
connections carry the profiler of the handle that borrowed them only while they are checked out. Each
Profiler\Log carries the statement's bound values, collection and operation (Event value).Utopia\Database\PDO::configure() for session settings that must survive a reconnect.Document::only() and except(), fromArray(), getArray(), getDocument(), getDocuments()
and the Document::ID, SEQUENCE, COLLECTION, CREATED_AT, UPDATED_AT, PERMISSIONS, TENANT and
DISTANCE key constants.Utopia\Database\Builder\SQLite, the query builder the SQLite adapter uses (dialectBuilder() returns it). It
extends Utopia\Query\Builder\SQLite and adds ESCAPE '\' to every LIKE predicate.Database::cursor() iterates over a query's matches in batches of CURSOR_BATCH_SIZE (100) by default (a
limit() in the queries caps the iteration, an offset() or cursorAfter() positions the first batch only),
Database::rawQuery() runs a SQL statement as written and returns its rows as documents (like from(), query()
and mutate() it checks no permissions, applies no tenant scope and runs only inside
getAuthorization()->skip(), otherwise Exception\Authorization), Query::containsString() matches a substring
of a string attribute, and the Redis adapter supports upserts.Query::exists() and Query::notExists() run on the SQL adapters. Each value names an attribute of the
collection that holds a column, or an alias.attribute of a join; other names throw Exception\Query.Authorization::withRoles() and Adapter::withTenant() scope the roles and the tenant to the calling coroutine,
and Hook\Relationships::withEnabled() and withCheckExist() scope the hook's flags the same way.
Database::snapshot(), Database::withSnapshot() and Hook\Relationships::withSnapshot() are @internal.withValidation(), withFiltering(), withPreserveDates() and
withPreserveSequence().Database::setCacheWriterTimeout() bounds how long an unfinished invalidation keeps a collection's document and
query cache off.Mirror::awaitReplications(?int $timeout = null) waits until every replication queued through the mirror has
reached the destination or has been reported to onError(), for example before a worker stops. A timeout of 0
returns at once; a negative one throws.
Mirror\Failure describes a failed replication.Exception\Schema, the parent of every schema violation, Exception::$state (a string code such as a SQLSTATE),
Exception\Unique::MESSAGE, Exception\Mismatch (a Duplicate for a shared-table column of another type),
Exception\Contention (a Transaction for a lock conflict with a concurrent transaction),
Exception\Unconfirmed (a MongoDB commit whose result could not be confirmed), Exception\Refused (an adapter
that returned false from a schema change) and Validator\Structure's storedAttributes parameter.false for throws Exception\Refused. A refused renameAttribute(),
renameIndex() or updateRelationship() has one message naming its keys (Failed to rename attribute 'a' to 'b')
instead of being wrapped like an adapter error (Failed to rename attribute 'a' to 'b': Failed to rename attribute), and a refused renameIndex() no longer tries to complete an earlier rename. These three also let an
adapter's Exception\Duplicate or Exception\NotFound through unwrapped, so renameAttribute() of a column the
table lacks throws Exception\NotFound on MariaDB and MySQL as documented. create(), update(), delete(),
createCollection() and deleteCollection() refuse a false too instead of ignoring it, so update() and
delete() return true whenever they return. See Errors.a-z, A-Z, 0-9, _ and - only, on every adapter,
and PostgreSQL refuses any other key also when validation is skipped. See Queries.createAttributes() fires attribute_create once per attribute and then attributes_create once with the list
(7.x fired attribute_create once, with an array, and never fired attributes_create).silent($callback, $hooks) silences the Hook\Named hooks with those names. A nested silent() never narrows
the silence around it, and silences apply to the calling coroutine and the coroutines it starts.Authorization::skip(), Database::skipRelationships(), skipRelationshipsExistCheck(), silent(),
withFiltering(), skipFilters(), withValidation(), skipValidation(), withPreserveDates(),
withPreserveSequence(), withTenant(), withRequestTimestamp(), ignoreDuplicates() and
Authorization::withRoles() are scoped to the calling coroutine
and the coroutines it starts; sibling coroutines sharing the handle or the Authorization no longer see them. The
plain setters (setStatus(), enable(), disable(), reset(), setTenant(), ...) still change the shared
value, except inside a scope over the same state (disable() inside skip(), setTenant() inside
withTenant()), including one the coroutine inherited from the coroutine that started it: there the change
applies to the calling coroutine and the coroutines it starts, and lasts until the scope ends. A coroutine sees a
scope only while every coroutine between it and the scope's owner is running; work that can outlive its starter
opens its own scopes. A coroutine cut off from a scope, because a coroutine between it and the scope's
owner has returned, reads the shared values or a scope opened outside every coroutine, and while a scope over the
same state is open on the handle its writes stay with it and the coroutines it starts; for Authorization,
skip() and withRoles() count together. Such a coroutine changes and restores state with those
scopes, not with a pair of setters. See Coroutines.Adapter\Pool, inside a coroutine
and outside withTransaction(), and only as many at once as Hook\Relationships::READ_CONCURRENCY (4) and
Pool::getReadConcurrency() (the connections the pool can hand out without waiting, less one) allow; elsewhere it
reads them one after another. Related documents are merged in chunk order.Exception\Authorization. See Relationships.Mirror replicates createDocuments(), updateDocuments(), upsertDocument(),
upsertDocuments(), deleteDocument() and deleteDocuments() in a coroutine of
its own, so the call returns once the source write is done (7.x wrote the destination before returning). Each
replication runs under the authorization status and roles, tenant, relationship and silence state and toggles
the caller had when it made the call. A mirror applies its changes to the destination one at a time, in the order
they were made through it: the calls that reach the destination before returning (createDocument(),
updateDocument(), increaseDocumentAttribute(), decreaseDocumentAttribute(), schema changes, create(),
delete(), exists(), setTimeout(), clearTimeout()) first wait for the queued replications, and later
replications wait for them. The write filters' document hooks run when the replication applies. Outside a coroutine
every replication finishes before the call returns.Mirror uses its source's Authorization and leaves the source's and destination's in place; in 7.x it started
with one of its own, which it also gave the source's adapter.Mirror::createDocument() returns the document written to the source, as updateDocument() does, instead of the
destination's copy.notContains on an array attribute excludes documents whose array is NULL or missing on every adapter; SQLite
and MongoDB used to include them.startsWith() and endsWith() match at the start and at the end of the value. They matched the
value anywhere in the string, so startsWith('foo') returned barfoo. Both stay case-sensitive.getDocument('Doc') finds doc.dateAddDays()/dateSubDays() shift the date, arrayFilter() filters the array, and the maximum or
minimum of increment, decrement, multiply, divide and power is honoured.Database::setTimeout() and clearTimeout() throw Adapter does not support timeouts on SQLite, Memory and
Redis; 7.x's SQLite ignored them. See Errors.setSchemaless(true) throws on an adapter without a schemaless mode (every adapter but MongoDB). 7.x's
setSupportForAttributes(false) returned the requested value on Memory and Redis without applying it.withTransaction() no longer retries deterministic failures: an invalid document (Structure), NotFound,
Query, Type, Index, Dependency, Truncate, any other typed library failure and any other exception (for
example InvalidArgumentException) run the callback once and are rethrown without sleeping, also in a nested call.
Only a failure that can succeed on another attempt is still retried twice with 7.x's backoff: an
Exception\Transaction (including Contention), a lost connection, an engine lock conflict the adapter did not
map, or a MongoDB error labelled transient, a network error before the commit or a command that was never sent.
Only the outermost withTransaction() retries it: a nested call rolls back to its savepoint and rethrows, so a
lock conflict that keeps failing runs a nested callback 3 times instead of 9. A MongoDB commit whose result is
unknown retries only the commit, up to 3 more times with a majority write concern, then fires the queued
document_purge events of the last attempt and throws Exception\Unconfirmed without running the callback again
(7.x ran the callback again); a schema call keeps the table, column or index of a definition whose commit is
unconfirmed. A MongoDB commit the server reports aborted, on the first attempt or on a commit retry, runs the
callback again: 7.x reported a first commit the server had aborted as a success, losing its writes. On SQL a
connection lost during COMMIT still runs the callback again, so that work is at-least-once. See
Errors.createCollection(), createAttribute(), createAttributes() and createIndex() keep the table, column or
index, and updateAttribute(), renameAttribute(), renameIndex(), deleteAttribute() and deleteIndex() keep
their change, when only the cache invalidation after their committed definition failed or its commit is
unconfirmed, and do not repeat the write. deleteCollection() and deleteRelationship() recreate the dropped
table or columns empty in that case and throw the failure wrapped. createRelationship() keeps a committed
relationship and still creates its indexes in that case; when its indexes fail and the definitions cannot be
removed, the columns are kept with them.createCollection() validates attribute types up front, like createAttribute(), and throws
Unknown attribute type: <type>. Must be one of <types> for an unknown one. updateAttribute() updates id
attributes and refuses relationship attributes (Cannot update relationship as an attribute).format (7.x metadata stores '') reads as null.Database::VAR_BIGINT ('bigint') becomes ColumnType::BigInteger, whose value is 'biginteger'. Collection
metadata still stores 'bigint', as in 7.x, so existing metadata needs no migration. Write a stored type with
Attribute::storedType() and read one with Attribute::typeFromStored().updateAttribute() with required: false relaxes the column's NOT NULL; 7.x's updateAttributeRequired(false)
changed only the metadata. AttributeUpdate(default: null) removes the default, format: null removes the
format, and a default sent with required: true throws. A Mirror replicates attribute updates.IntegerWidth::Bits64, 7.x size 8) gets the bounds [PHP_INT_MIN, PHP_INT_MAX], or
[0, PHP_INT_MAX] unsigned, in increaseDocumentAttribute(), decreaseDocumentAttribute() and the numeric
operators; 7.x applied the 32-bit range.createAttribute() and
createIndex(), as MariaDB, MySQL and SQLite do.<method>_<attribute>, or <method> for count('*').cursor() treats a limit() as a cap on the documents it yields.Adapter\Mongo::exists() reports a database only when the server lists it (it returned true for every name),
and collectionExists() looks in the database it is given.Database::delete() still flushes the whole cache it was given, as in 7.x: on a cache shared with other databases
(one Redis), give each database handle a cache of its own.Connection::hasError() classifies by driver error code (MySQL and MariaDB 1053, 2002, 2006, 2013 and 4031;
SQLSTATE class 08; PostgreSQL 57P01 to 57P05) before matching messages, and its message list matches Swoole 6.2.Database::setMetadata() comments precede every statement the SQL adapters prepare, ahead of registered
Transform hooks. Arrays, null and objects are rendered as JSON. Keys and values are normalised: comment
delimiters are split, control characters become spaces and invalid UTF-8 is replaced.purgeCachedQueries() also purges the find() query cache, and returns false when either purge fails.deleteDocument() fires document_update for each document on the other side of a two-way relationship that the
delete changed, as 7.4.0 does. When a hook throws, document_delete and every related document_update still
fire, and the first exception reaches the caller afterwards. Finding the peers a cascade left costs a read per
related collection, which a delete skips unless an active lifecycle hook handles document_update. See
document_update for related documents a delete changed.updateDocument(), increaseDocumentAttribute(), decreaseDocumentAttribute() and
deleteDocument(), and the page reads of updateDocuments() and deleteDocuments(), use the collection
definition the write resolved instead of reading it again: a schema change committed after the write resolved its
definition, or between two pages, is not seen by that read or those pages, as the write validated and encoded
under the earlier one. A bulk write reads _metadata at most once per call instead of once per page. A Database
subclass's getDocument() and find() overrides are no longer called for these reads, and its getCollection()
and findCollection() overrides are not called by getDocument(Database::METADATA, ...) while no
Hook\Decorator is registered or events are silenced. See Caches.Adapter\Pool::syncBorrowed() replays metadata, the profiler and transforms onto a connection only when the
connection's differ from the pool's, as it already did for write hooks; the tenant, schemaless mode, timeouts and
the other settings are still synced on every delegated call. A Pool subclass or custom connection adapter can
no longer rely on resetMetadata(), setMetadata(), setProfiler(), resetTransforms() or addTransform()
being called on every delegated call. See Pool extension points.Query::contains(). Use containsString() for substring matching on string attributes and containsAny() for
array attributes. Queries whose method is contains (for example parsed from JSON) keep working.Database::on(), Database::before(), Mirror::on() and Adapter::before().Adapter\Pool::$pinnedAdapter property. A subclass reads the connection the calling coroutine's
transaction pinned through pin(). See Pools and profiling.Database::VAR_*, INDEX_*, ORDER_*, PERMISSION_*, RELATION_*, CURSOR_* and EVENT_* constants, the
Query::TYPE_* constants, the Operator::TYPE_* constants and the Document::SET_TYPE_* constants, replaced by
enums, and Database::SPATIAL_TYPES, ATTRIBUTE_FILTER_TYPES, INTERNAL_ATTRIBUTES, INSERT_BATCH_SIZE and
DELETE_BATCH_SIZE. See Constants are now enums.Utopia\Database\Helpers\*, Mirroring\Filter, Validator\Attribute, Validator\Index, Validator\Queries,
Validator\IndexedQueries and Validator\ObjectValidator, moved without aliases. See
Namespaces.updateAttributeRequired(), updateAttributeFormat(), updateAttributeFormatOptions(),
updateAttributeFilters(), updateAttributeDefault() and getInternalAttributes(). See
Schema: value objects.upsertDocumentsWithIncrease(), iterate(), foreach() and the $onError parameters. See
Bulk writes and reads.enableValidation(), disableValidation(), enableFilters(), disableFilters(), enableLocks(),
getPreserveDates(), getPreserveSequence(), getDropUnknownAttributes(), getSharedTables(),
getTenantPerDocument(), skipDuplicates(), clearAllDocumentTypes(), getKeywords() and
Authorization::setDefaultStatus(). See Configuration toggles.Document::getRead(), getCreate(), getUpdate(), getDelete(), getWrite(), find(), findAndReplace(),
findAndRemove() and the getArrayCopy() filter parameters. See Documents.Adapter::getSupportFor*() methods and getSupportNonUtfCharacters(). See
Capabilities and features.getLimitFor*(), getMax*(), getCountOfDefault*(), getIdAttributeType(),
getDocumentSizeLimit(), getKeywords(), getInternalIndexesKeys()). See
Limits and profile.ping(), reconnect(), getHostname(), getConnectionId(), setSupportForAttributes(),
clearTimeouts(), enableAlterLocks(), setDebug(), getDebug(), resetDebug(), castingBefore(),
castingAfter(), setUTCDatetime(), decodePoint(), decodeLinestring() and decodePolygon(), and the
per-adapter methods listed in Methods an adapter no longer has:
Mongo::getSchemaAttributes() and getSchemaIndexes() answer [], Mongo::getConnectionId() is id(), and
Memory::upsertDocuments() is gone with Feature\Upserts.SQL::getPDOAttributes() and the protected SQL::getPDO() (use getDriver()). Change::getOld(), setOld(),
getNew() and setNew() (use the readonly old and new).getSQLConditions(), getSQLCondition(),
getSQLPermissionsCondition(), getFulltextValue(), getTenantQuery(), getLikeOperator(),
getRegexOperator(), getAttributeProjection(), getRandomOrder(), the insert and upsert statement hooks, and
others). See Removed adapter methods.Mongo::getTenantQuery(), which returned an empty string, and SQL::getSpatialTypeFromWKT(). Nothing in the
library calls either. See Removed adapter methods.getSQLIndexType() on SQL and SQLite,
Postgres::getSQLSchema(), Postgres::encodeArray(), Postgres::decodeArray() and
Memory::unregisterRelationshipField(). See Removed adapter methods.Adapter\SQL::setFloatPrecision(), Adapter\SQLite::setEmulateMySQL(), getEmulateMySQL(),
Database::getInstanceFilters(), Mirror::getWriteFilters() and Validator\Structure::getFormats(), which
nothing calls. See Removed unused public methods.getSQLTable(), getSQLType(),
getOperatorSQL(), bindOperatorParams(), getIdentifierQuoteChar(), ...) and Redis::tx(). See
Writing or subclassing an adapter.deleteRelationship() recreates the relationship's indexes, or its junction collection's definition, when the
adapter refuses or fails to drop the relationship, instead of leaving them dropped while the relationship stays.
On MongoDB, Adapter\Mongo::createCollection() of an existing collection throws Exception\Duplicate, as on the
SQL adapters, instead of adopting it without its indexes; under shared tables and for the metadata collection it
first creates the collection's indexes, and Database::createCollection() adopts the collection. An index
conflict (code 85) throws Exception\Index. A collection it created but could not give its indexes is dropped,
outside a transaction and unless tables are shared, and a refused createCollection() stores no definition.
Under shared tables, createCollection() no longer drops the table when storing the definition fails: another
tenant may already have adopted it, and the drop removed every tenant's documents.
createAttributes() drops the columns it created one at a time before a later column failed, instead of leaving
them in the schema without a definition.
updateRelationship() completes an earlier attempt only when every column it renames is already under its new
name and no longer under its old one, instead of adopting any column under the new key.
On PostgreSQL with shared tables, renameIndex() no longer reports a rename done because another tenant's copy
of the index has either name; only the tenant's own index, or the one created with the shared table, counts.
updateDocument() no longer fails with Exception\Structure (Unknown attribute) when a schema change commits
between its collection definition lookup and its locked read of the document.
Mirror::clearDocumentTypes() keeps the metadata collection's Collection type, so the mirror's
getCollection() still returns a Collection (it returned a plain Document).
Adapter::hasFeature() no longer tells PHPStan the adapter implements the feature: a Pool answers true for a
feature it forwards without implementing it, so code narrowed by the check called methods the pool does not have.
A spatial index created through a pooled adapter is no longer refused by an instanceof check.
sum() and count() throw Exception\Query for a $max of 0 or less instead of returning 0.
A relationship with a stored onDelete of setDefault or noAction is refused with Exception\Relationship;
it was accepted, and deleting the parent left dangling children.
A join's ON list holding anything but on() conditions and filters (limit(), select(), ...) throws when the
query is built, and the join keeps its alias (utopia-php/query 0.7).
Collection::create(documentSecurity: false) stores false (it read back true), and a collection's other keys
are either stored or refused with Exception\Structure, never dropped.
A Mirror honours the Hook\Relationships it is given (for example prepare: false) on its source and its
destination; it rebuilt the hook with the default settings.
In deleteDocuments()'s onNext, the second argument is a separate copy of the stored document, so a callback
that changes the first argument no longer changes what it is told the previous state was.
findOne() fires nothing when no document matches (it fired document_find with false), and aggregate()
fires document_aggregate instead of document_find.
addHook() throws for a hook it does not recognise instead of registering nothing.
increaseDocumentAttribute() and decreaseDocumentAttribute() throw Exception\Type for a change value of 0 or
less instead of InvalidArgumentException.
MySQL::getSpatialSqlType() is protected, as on the other SQL adapters; MySQL made it public.
UPGRADE.md, README.md, AGENTS.md and docs/add-new-adapter.md no longer misstate the last 7.x release (7.4.0), the query validator parameters, the adapter contract and the project layout.
A well-known-text polygon with holes decodes into its rings on MariaDB, MySQL and PostgreSQL; the rings were merged into one.
Deleting a many-to-many relationship on Redis and Memory drops its junction collection, as the SQL and MongoDB adapters do; recreating the relationship hit the leftover junction.
The point, linestring and polygon filters no longer swallow an encoder failure and write the value as given.
aggregate() throws Exception\Query for two aggregates that would come back under the same default alias,
instead of collapsing their values into one key when validation is off.
A Hook\Relationships added to a second database throws instead of rebinding to it, and a query cache shared by
several databases uses each caller's cache name and writer timeout instead of the last one it was set on.
Mirror\Failure names DocumentUpsert for a failed upsertDocument() (it was null) and IndexesCreate for a
failed createIndexes().
With validation skipped, the SQL adapters filter the attribute of sum() and the grouped columns they qualify
with a join alias, and every identifier they quote escapes the quote character.
A delete retried on the same Database after its cascade failed (for example on a Restricted related document
or a permission failure) now runs the cascade.
Mirror forwards setCacheName(), setGlobalCollections(), resetGlobalCollections(),
setTenantPerDocument(), setCacheWriterTimeout(), setTimeout(), clearTimeout(), setMetadata(),
resetMetadata(), setFiltering(), withFiltering(), skipFilters(), setLocks(), setProfiling(),
setMigrating() and setFilters() to its source and destination.
Scopes entered on a Mirror apply to its source: withTenant(), withPreserveDates() and
withPreserveSequence() to its destination as well, skipRelationships(), skipRelationshipsExistCheck() and
withRequestTimestamp() to the source only. withRequestTimestamp() runs its callback once.
Mirror::setLocks() reports a destination that cannot apply the setting through onError() (method
setLocks) instead of throwing after the source applied it, and Mirror::create() throws when the destination
cannot create the database.
A Mirror write filter whose beforeCreateCollection(), beforeUpdateCollection(), beforeUpdateAttribute() or
beforeCreateIndex() returns null skips that change on the destination, as Mirror\Filter documents; the
mirror returns the source's result, and a collection whose creation was skipped is not replicated.
Mirror::createDocument() and updateDocument() restore the destination's preserve-dates setting after
replicating, also when the destination write fails.
Mirror::upsertDocument() and an increasing Mirror::upsertDocuments() run on the source and replicate to the
destination.
createCollection(), createAttribute() and createAttributes() no longer modify the Attribute and Index
objects passed to them.
resetMetadata() removes the query comments at once; the previous metadata no longer annotates later statements.
Without Swoole's library, MySQL 8.0.24+'s idle disconnect (error 4031) is recognised as a lost connection and reconnected, instead of failing the first query after every idle period.
Linking a related document at any nesting depth of an update needs update permission on that document, and throws
Exception\Authorization without writing anything when the caller lacks it.
deleteDocuments() with a select no longer skips a one-to-one or one-to-many Cascade or ignores Restrict on
one-to-one, one-to-many and many-to-many relationships. Cascade and restrict targets are read from storage with
permissions skipped, as SetNull already did, so related documents the caller cannot read are cascaded (subject
to the caller's delete permission on each) or block a Restrict delete.
A nested one-to-one write that throws no longer leaves an entry on the relationship write stack. Before, every
later write on the same Database treated its nested relationships as one level deeper and dropped the deepest
ones without an error.
Coroutines sharing a Database keep their own relationship write and cascade stacks (also in 7.x). Before, a
coroutine in the middle of a nested relationship write made another coroutine's nested writes look deeper, so their
deepest related documents were dropped without an error, and a coroutine in the middle of a cascading delete could
stop another coroutine's cascade, leaving its related documents behind.
Adapter\Pool pins a transaction's connection for the coroutine that opened the transaction and the coroutines it
starts (also in 7.x). Before, every coroutine sharing the handle ran its statements on that connection while the
transaction was open, so they were committed or rolled back with it and their own withTransaction() became a
savepoint in it. Each call on the pinned connection also runs under its own coroutine's tenant; before, two
coroutines with different withTenant() scopes overwrote each other's tenant on it.
A filter on a nested relationship path (for example Query::equal('children.tags.name', [...])) no longer throws
Exception\Query when a step of the path matches more documents than getMaxQueryValues(): each step reads its
matches in chunks within the limit. A path that passes through the parent side of a one-to-many or the child side
of a many-to-one no longer throws Cannot select attributes.
Linking a document by value in a two-way one-to-one update stores the back-reference on the related document, and
writes its nested documents as deep as createDocument() does.
A new related document created through a many-to-many update keeps the $permissions it was given. Before, they
were always replaced by the parent's. A related document created without $permissions still takes the parent's.
A nested withTransaction() whose enclosing transaction was lost (for example, the server ended the session)
throws Exception\Transaction, and so does the outer call. Before, the nested call began a fresh top-level
transaction and committed its own writes alone while the outer call returned normally. A top-level
withTransaction() whose commit finds the connection no longer holds the transaction throws
Exception\Transaction instead of returning as if its work were stored; commitTransaction() no longer returns
false for it.
A nested withTransaction() whose statement lost a deadlock on MariaDB or MySQL rethrows the deadlock
(Exception\Contention), and the outermost call runs again as in 7.x. The engine rolls the whole transaction back,
so nothing of that attempt is stored. The 8.0 pre-releases reported such a transaction as lost and did not run it
again.
Utopia\Database\PDO refuses statements after a reconnect lost the open transaction, until the transaction is
rolled back, so a swallowed connection error can no longer make later statements autocommit.
Utopia\Database\PDO::reconnect() replays attributes set with setAttribute() after connecting.
Increasing or decreasing an optional numeric attribute that was never set stores the result (the unset value
counts as zero), on every adapter; before, the SQL adapters left the column NULL and MongoDB rejected the update. A
max/min bound also treats the unset value as zero.
On MariaDB and MySQL, updateDocument() stores a case-only rename (abc → ABC) even when it is looked up by the
new casing, and moves the document's permission rows with it.
find() no longer changes the cursor document passed to Query::cursorAfter()/cursorBefore().
updateDocuments() inside withRequestTimestamp() compares each stored document's $updatedAt with the request
timestamp, instead of always throwing Exception\Conflict.
updateDocuments() hands onNext every attribute it wrote decoded, once, including under a select that leaves
the attribute out and after a retried transaction; nothing the select left out is added.
In a two-way one-to-one relationship, updateDocument() rejects a document already linked to another document with
Exception\Duplicate (Document already has a related document) before writing anything, and no longer rejects
a free document whose id matches a linked document of the other collection.
createDocuments() under ignoreDuplicates() writes permissions only for the documents it inserted. A replayed
fix(operators): reject operators on encrypted attributes (7.4.x) in https://github.com/utopia-php/database/pull/1012
Full Changelog: https://github.com/utopia-php/database/compare/7.4.1...7.4.2
fix(indexes): fail unique index creation over duplicate rows by @HarshMN2345 in https://github.com/utopia-php/database/pull/998
Full Changelog: https://github.com/utopia-php/database/compare/7.4.0...7.4.1
feat: fire update events for documents a delete changes through a relationship by @HarshMN2345 in https://github.com/utopia-php/database/pull/981
Full Changelog: https://github.com/utopia-php/database/compare/7.3.12...7.4.0
fix: look up referencing documents in deleteSetNull instead of trusting the relationship value by @HarshMN2345 in https://github.com/utopia-php/databa
Full Changelog: https://github.com/utopia-php/database/compare/7.3.11...7.3.12
fix: clarify invalid reverse one-way relationship values by @HarshMN2345 in https://github.com/utopia-php/database/pull/975
Full Changelog: https://github.com/utopia-php/database/compare/7.3.10...7.3.11
fix: return the mapped document type for an empty id by @loks0n in https://github.com/utopia-php/database/pull/974
Full Changelog: https://github.com/utopia-php/database/compare/7.3.9...7.3.10
fix: respect query value limits when loading relationships by @HarshMN2345 in https://github.com/utopia-php/database/pull/964
Full Changelog: https://github.com/utopia-php/database/compare/7.3.8...7.3.9
chore: allow utopia-php/console 0.2 by @loks0n in https://github.com/utopia-php/database/pull/965
Full Changelog: https://github.com/utopia-php/database/compare/7.3.7...7.3.8
fix: stop internal keys stealing user attributes named after them by @HarshMN2345 in https://github.com/utopia-php/database/pull/961
Full Changelog: https://github.com/utopia-php/database/compare/7.3.6...7.3.7
perf: skip unused variant hashes when purging cached documents by @loks0n in https://github.com/utopia-php/database/pull/960
Full Changelog: https://github.com/utopia-php/database/compare/7.3.5...7.3.6
perf: reduce database document and conversion allocations by @loks0n in https://github.com/utopia-php/database/pull/958
Full Changelog: https://github.com/utopia-php/database/compare/7.3.4...7.3.5
Optimize get sequences by @fogelito in https://github.com/utopia-php/database/pull/953
Full Changelog: https://github.com/utopia-php/database/compare/7.3.3...7.3.4
fix(adapter): write permission rows with the document's tenant on update by @abnegate in https://github.com/utopia-php/database/pull/952
Full Changelog: https://github.com/utopia-php/database/compare/7.3.2...7.3.3
CLOUD-3JK8 by @ArnabChatterjee20k in https://github.com/utopia-php/database/pull/951
Full Changelog: https://github.com/utopia-php/database/compare/7.3.1...7.3.2
chore: require validators 0.6 by @ChiragAgg5k in https://github.com/utopia-php/database/pull/950
Full Changelog: https://github.com/utopia-php/database/compare/7.3.0...7.3.1
feat: drop unknown attributes on schema-managed writes instead of failing by @abnegate in https://github.com/utopia-php/database/pull/946
Full Changelog: https://github.com/utopia-php/database/compare/7.2.7...7.3.0
Fix createIndex for sequence by @fogelito in https://github.com/utopia-php/database/pull/944
Full Changelog: https://github.com/utopia-php/database/compare/7.2.6...7.2.7
chore: allow utopia-php/cache ^5.0 by @loks0n in https://github.com/utopia-php/database/pull/943
Full Changelog: https://github.com/utopia-php/database/compare/7.2.5...7.2.6
Select queries skip filters on unselected attributes by @fogelito in https://github.com/utopia-php/database/pull/941
Full Changelog: https://github.com/utopia-php/database/compare/7.2.4...7.2.5
fix: match Mongo document permissions with exact strings by @abnegate in https://github.com/utopia-php/database/pull/940
Full Changelog: https://github.com/utopia-php/database/compare/7.2.3...7.2.4
improve storage calculations by @fogelito in https://github.com/utopia-php/database/pull/930
Full Changelog: https://github.com/utopia-php/database/compare/7.2.2...7.2.3
Allow validators 0.5 by @ChiragAgg5k in https://github.com/utopia-php/database/pull/937
Full Changelog: https://github.com/utopia-php/database/compare/7.2.1...7.2.2
fix(mongo): bump to 1.5.3 so integers past int32 survive a read by @abnegate in https://github.com/utopia-php/database/pull/936
Full Changelog: https://github.com/utopia-php/database/compare/7.2.0...7.2.1
Unique Exception by @fogelito in https://github.com/utopia-php/database/pull/733
Full Changelog: https://github.com/utopia-php/database/compare/7.1.4...7.2.0
fix: preserve empty object attributes (DAT-2310) by @abnegate in https://github.com/utopia-php/database/pull/935
Full Changelog: https://github.com/utopia-php/database/compare/7.1.3...7.1.4
Sort createdAt updatedAt unique tie break by @fogelito in https://github.com/utopia-php/database/pull/933
Full Changelog: https://github.com/utopia-php/database/compare/7.1.2...7.1.3
Allow validators 0.4 by @ChiragAgg5k in https://github.com/utopia-php/database/pull/932
Full Changelog: https://github.com/utopia-php/database/compare/7.1.1...7.1.2
One column per quarter.