Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4777d92
fix(validator): restore the 7.x query validation order and messages
abnegate Oct 9, 2026
d1b2b76
fix(postgres): match an exact search term as 7.x did
abnegate Oct 9, 2026
0c071c8
fix(query): match containsAll on a string attribute as 7.x did
abnegate Oct 9, 2026
8f0218c
test(validator): expect the 7.x message for an aggregate on a single-…
abnegate Oct 9, 2026
07a921b
fix(query): read a random order with a cursor as 7.x did
abnegate Oct 9, 2026
09c1b87
fix(events): fire document_purge before the outermost commit as 7.x did
abnegate Oct 9, 2026
d5ead40
fix(validator): word a mismatched attribute default as 7.x did
abnegate Oct 9, 2026
02413b7
fix(documents): refuse a counter change that is not above zero with I…
abnegate Oct 9, 2026
9b58ef1
fix(documents): apply a fractional counter change on an integer as 7.…
abnegate Oct 9, 2026
a48af91
fix(index): refuse an unknown index type as 7.x did
abnegate Oct 9, 2026
9d4b799
fix(exception): keep the 7.x message of a unique index violation
abnegate Oct 9, 2026
5d1036a
fix(operator): check numeric operators on integers and doubles as 7.x…
abnegate Oct 9, 2026
15c64b6
fix(query): drop the cursor of any read with a random order as 7.x did
abnegate Oct 9, 2026
1eb8ef0
docs: record the 8.0.1 restores of 7.x behaviour
abnegate Oct 9, 2026
9c6126b
fix(validator): type the 7.x numeric and nested query checks for stat…
abnegate Oct 9, 2026
0057026
test(exception): expect the 7.x unique violation message in the e2e d…
abnegate Oct 9, 2026
93d21d8
test(query): expect MongoDB's $all for containsAll on a string
abnegate Oct 9, 2026
22e2b59
fix(relationships): read a 7.x junction index under the name the engi…
abnegate Oct 10, 2026
e0857f0
fix(sql): bind floats as 7.x did so writes keep small magnitudes
abnegate Oct 10, 2026
6f91593
fix(relationships): keep two-level relationship selects as 7.x return…
abnegate Oct 10, 2026
d6f3b4e
fix(sql): read select(['*', '*.*']) as every column, as 7.x did
abnegate Oct 10, 2026
9428561
fix(sql): return $sequence ahead of $id on a single read as 7.x did
abnegate Oct 10, 2026
07e8048
fix(documents): validate the stored values an update leaves unchanged…
abnegate Oct 10, 2026
c7cf07a
fix(mongo): retry a transaction that lost a write conflict until it l…
abnegate Oct 10, 2026
c571c82
test(mongo): pin the write conflict retries and type the single-read …
abnegate Oct 10, 2026
4b06438
test(mongo): read shared tables through hasSharedTables() in the conc…
abnegate Oct 10, 2026
942912c
docs: record the upgrade-differential restores in 8.0.1
abnegate Oct 10, 2026
042861a
test(relationships): narrow the related documents in the 7.x relation…
abnegate Oct 10, 2026
faeeb0d
fix(relationships): keep a linked child's $updatedAt under preserved …
abnegate Oct 10, 2026
be068f0
test(relationships): narrow the linked author in the preserved-dates …
abnegate Oct 10, 2026
9b8e746
fix(documents): return $sequence ahead of $id on a single read on eve…
abnegate Oct 12, 2026
9d4d4a2
fix(relationships): link a stored related document sent as a document
abnegate Oct 12, 2026
1730bb7
fix(relationships): hold nested links to the link rule for every rela…
abnegate Oct 12, 2026
5b6f561
feat(documents): check a write's permissions without writing it
abnegate Oct 12, 2026
038dee4
docs: record the 8.0.1 link rule, stored link and write pre-check
abnegate Oct 12, 2026
0c18efa
style: type the link rule tests and the pre-check's operator read for…
abnegate Oct 12, 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
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
# Changelog

## 8.0.1

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.

### Added

- `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.

### Fixed

- Query validation reports what 7.x reported: the children of `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.
- The `UID` validator description is the 7.x text again, also inside `Invalid cursor: …`.
- On PostgreSQL an exact search (`"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.
- A read whose orders include `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.
- Numeric operators on integer and double attributes are checked as in 7.x: a fractional change or limit, or a
fractional item appended to an integer array, is no longer refused.
- A mismatched attribute default reads `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.
- A many-to-many relationship created by 7.x can be renamed again: its junction index, which 7.x stored with `key`
`index_<key>`, is read under its `$id` `_index_<key>`.
- The SQL adapters bind floats as 7.x did: fixed-point only in `find()`, as PHP writes them elsewhere, so a write
no longer stores `1e-300` or `-2.5e-20` as `0`.
- Two-level relationship selects (`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.
- A single read returns `$sequence` ahead of `$id`, in 7.x's key order, on every adapter.
- An update validates the stored values it leaves unchanged again, as 7.x did; a stored object value is held to
7.x's object rules.
- On MongoDB a transaction that lost a write conflict runs again up to 20 times, so concurrent increments of one
document all land.
- With dates preserved, linking existing children through their one-to-many parent keeps each child's stored
`$updatedAt`, as 7.x did; unlinking still stamps the child.
- Linking a stored related document by ID needs update permission on it for every relationship type, as UPGRADE.md
states: a one-way one-to-one link, a many-to-one link and a one-to-many child pointing at its parent linked with
read permission alone in 8.0.0, as in 7.x.
- A nested write refuses a stored related document the caller cannot read with `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`.
- A stored two-way one-to-one or one-to-many related document given as a document in a new parent is linked to
it; 8.0.0 and 7.x updated it but left its reference to the parent empty.

## 8.0.0 (unreleased)

8.0 is a major release. Read [UPGRADE.md](UPGRADE.md) before you upgrade from 7.x: it lists every change you may
Expand Down
Loading
Loading