Repository navigation
fix(expressions): validate in the service's order, with its messages - #399
LeeroyHannigan wants to merge 39 commits into
Conversation
| // itself; whether that function may stand alone, whether its name exists, | ||
| // and how many operands it takes are semantic questions answered after | ||
| // the grammar pass (see `validate_condition_semantics`), so a syntax error | ||
| // further along still wins, as on Amazon DynamoDB. |
There was a problem hiding this comment.
What does "wins" mean in this context?
There was a problem hiding this comment.
"Wins" meant precedence between two errors in one expression, and the comment did not say so. The grammar pass in parser.rs reports every syntax error first; the semantic checks (function name, whether a function may stand alone, operand count) run afterwards in validate_condition_semantics (crates/core/src/expression/semantics/condition_rules.rs:31), over the whole parsed tree. So for foo(pk) AND the response is the syntax error at the end of the text, not the unknown function name that appears first.
The service has the same precedence. Measured 2026-10-23 on PutItem: foo(pk) AND, ATTRIBUTE_EXISTS(pk) AND, begins_with(pk, :n) AND (with :n a number) and attribute_exists(#x) AND (with #x undefined) each answer Invalid ConditionExpression: Syntax error; token: "<EOF>", near: "AND"; foo(pk) alone answers Invalid function name; function: foo. The four cases are pinned in TestConditionFunctions.test_a_syntax_error_beats_the_semantic_errors in tests/test_expression_semantics.py (343c2fb).
I rewrote the comment to say this without the word (crates/core/src/expression/parser.rs:136-144, and the same wording in update_parser/mod.rs:279-286), in a8d83c6.
There was a problem hiding this comment.
|
|
||
| let mut args = Vec::new(); | ||
| if *pos < tokens.len() && tokens[*pos] != Token::RParen { | ||
| // `f()` is a syntax error on the service, reported at the `)`. |
There was a problem hiding this comment.
A syntax error because there are no arguments? Please clarify.
There was a problem hiding this comment.
Yes. The service's grammar needs at least one operand between the parentheses, so attribute_exists() and foo() are refused at the ) as a syntax error, Syntax error; token: ")", near: "()", before the function name or the operand count is looked at. Measured 2026-10-23 for both spellings on PutItem (ConditionExpression); the UpdateItem case SET x = foo() was measured 2026-10-14. One operand too few is a different error: begins_with(pk) parses and the semantic pass reports Incorrect number of operands for operator or function; operator or function: begins_with, number of operands: 1 (also measured 2026-10-23).
The check is at crates/core/src/expression/parser.rs:241-251 (and update_parser/mod.rs for SET operands); the wire cases are foo(), attribute_exists() and begins_with(pk) in TestConditionFunctions in tests/test_expression_semantics.py. I rewrote the comment to say this in a8d83c6.
| /// Per-table capacity totals in the order the tables first appear in the | ||
| /// request. | ||
| /// | ||
| /// Amazon DynamoDB's own order of the `ConsumedCapacity` entries of a |
There was a problem hiding this comment.
I can't tell if this is saying ExtendDB's behavior (in terms of sorting) is now equivalent to DynamoDB's, or if ExtendDB is providing firmer ordering guarantees than DynamoDB (and why).
There was a problem hiding this comment.
It is now the service's order. DynamoDB documents no order for the ConsumedCapacity entries of a transaction, so I measured it on 2026-10-23 with three tables created on 2026-10-22, 2026-10-23 11:01 and 2026-10-23 14:45 UTC, with names that sort opposite to the creation order. For the request orders [newest, middle, oldest], [middle, newest, oldest] and [oldest, newest, middle], TransactGetItems and TransactWriteItems both returned the tables oldest first. The order follows neither the request nor the names, it follows the tables' creation time.
PerTableCapacity (now crates/engine/src/per_table_capacity.rs) orders the entries by creation time, oldest first, with name order breaking a tie. TableKeyInfo carries the creation time from the catalog row the handlers already read for the key schema, so there is no extra catalog read. Before this PR the handlers aggregated into a HashMap and the order changed between processes and backends.
Two tables tie when their stored creation times are equal, and the precision of that value differs per backend: nanoseconds on SQLite, microseconds on PostgreSQL, milliseconds on MongoDB and Cassandra. MongoDB was writing whole seconds, so three tables created inside one second got the same value and came back in name order; that write now keeps the millisecond part. A catalog row written by an earlier build still holds whole seconds. tests/test_transact_capacity_order.py creates three tables whose names sort opposite to their creation order and asserts the order on both operations; it runs against the service and against ExtendDB, and it passes on SQLite, PostgreSQL and MongoDB. docs/differences-from-dynamodb.md has the row under Capacity and Throttling, with the precision per backend.
| }; | ||
|
|
||
| // Validate begins_with operand types upfront (before any rows are read). | ||
| if let Some(ref f) = filter { |
There was a problem hiding this comment.
Where are these checks happening now?
There was a problem hiding this comment.
The expression form moved them into the semantic pass. The legacy QueryFilter path lost them, which was a regression in this PR; it is fixed in 343c2fb and 4132394.
FilterExpression: the begins_with and ordering operand checks run inside the semantic pass, at request time, before the table lookup. The call is parse_condition_checked at crates/engine/src/query.rs:170, which runs validate_condition_semantics (crates/core/src/expression/semantics/condition_rules.rs:31); the begins_with operand type is at condition_rules.rs:131 and the ordering operand types at condition_rules.rs:54 and 60. The checks are in the walk because the service reports them in expression order with the other semantic errors (#x = :v AND begins_with(pk, :n) with an undefined #x reports the name, begins_with(pk, :n) AND #x = :v reports the operand type; both in TestConditionFunctions). Covered by tests/test_expr_operand_type_and_size.py and tests/python/test_begins_with_type_check.py.
QueryFilter (legacy): desugar_filter bypasses the parser, so the removal left that path with no request-time check; an empty table returned 200 and a non-empty one failed on the first row evaluated. The service checks each legacy condition at request time, before the table lookup, with its own messages. I measured the full operator by type grid on 2026-10-23: One or more parameter values were invalid: ComparisonOperator BEGINS_WITH is not valid for N AttributeValue type and the same text for every other refused pair (EQ and NE take every type; BEGINS_WITH takes S and B; CONTAINS and NOT_CONTAINS take S, N, B, BOOL and NULL; the ordering operators, BETWEEN and IN take S, N and B), plus the value count (Invalid number of argument(s) for the <op> ComparisonOperator), mixed types (AttributeValues inside AttributeValueList must be of same type), an inverted BETWEEN range and an unknown operator name. validate_legacy_condition in crates/engine/src/legacy_filter.rs now runs those checks on each QueryFilter, ScanFilter and KeyConditions entry before it is desugared, with the service's text; the Invalid FilterExpression: wording is gone. The grid is pinned in the engine's unit tests (legacy_filter_tests.rs) and one row per message on the wire in TestLegacyFilterOperandType in tests/test_expr_operand_type_and_size.py.
There was a problem hiding this comment.
The 31 October rebase rewrote the two commits this reply cites: 343c2fb is now 475465a, and 4132394 is now 90fdc32. At 2d137cc the lines it names are, in its order, crates/engine/src/query.rs:174, crates/core/src/expression/semantics/condition_rules.rs:30, :119, :53 and :59, and validate_legacy_condition at crates/engine/src/legacy_filter.rs:388.
| } | ||
|
|
||
| // Validate begins_with operand types upfront (before any rows are scanned). | ||
| if let Some(ref f) = filter { |
There was a problem hiding this comment.
Similar question to query.rs: where are these checks happening now?
There was a problem hiding this comment.
The answer is the same as for Query. FilterExpression: inside the semantic pass through parse_condition_checked at crates/engine/src/scan.rs:197, before the projection, the unused check and the table lookup (scan.rs:300); the begins_with and ordering operand checks are at crates/core/src/expression/semantics/condition_rules.rs:131, 54 and 60.
ScanFilter (legacy): the check had been dropped. 343c2fb and 4132394 restore it in desugar_filter (validate_legacy_condition in crates/engine/src/legacy_filter.rs) with the service's messages, measured 2026-10-23 on an empty table for every operator and type: BEGINS_WITH with a number answers One or more parameter values were invalid: ComparisonOperator BEGINS_WITH is not valid for N AttributeValue type, LT with a boolean names BOOL, BETWEEN with a list then a number names L, and the value count, mixed types, inverted BETWEEN range and unknown operator get their own texts. The ScanFilter rows are in TestLegacyFilterOperandType in tests/test_expr_operand_type_and_size.py.
There was a problem hiding this comment.
The 31 October rebase rewrote the two commits this reply cites: 343c2fb is now 475465a, and 4132394 is now 90fdc32. At 2d137cc the lines it names are, in its order, crates/engine/src/scan.rs:179 and :309, crates/core/src/expression/semantics/condition_rules.rs:119, :53 and :59, and validate_legacy_condition at crates/engine/src/legacy_filter.rs:388.
jcshepherd
left a comment
There was a problem hiding this comment.
Some of the agent-generated comments are read pleasantly but actually are ambiguous which makes it hard to determine whether the code is even solving a real problem. I flagged a couple. Also some operand validation code in query.rs and scan.rs was deleted and it's not obvious that it is still being done somewhere (assuming it was needed).
| /// | ||
| /// Returns `DynamoDbError::ValidationException` naming the first undefined | ||
| /// reference, names before values, in the order the expressions are given. | ||
| pub fn validate_refs_defined( |
There was a problem hiding this comment.
Removed in d28de7a, with its re-export. It had no caller, and its doc comment described an order it did not follow, because it sorted both lists. The parser now checks the undefined references of a key condition as it walks the tokens, so the error names the first one in the text.
jcshepherd
left a comment
There was a problem hiding this comment.
Dead code in resolver.rs: otherwise okay.
…ts messages Issue #108 lists 106 requests whose response differs from Amazon DynamoDB. Every expectation in this change was measured against the service (us-east-1, 2026-10-14); the probes and captured responses are in the issue's notes, and every new test file was run against the service before it was run here. Semantic validation of expressions. After the grammar pass, the service walks the parsed expression once, in expression order, checking each node after its operands, then checks overlapping paths, then unused names and values. A new `validate_update_semantics` and `validate_condition_semantics` in the core crate follow that walk; the parsers now do grammar only, keep function names as written, and record section order for the walk. - UpdateExpression: `+` and `-` take numbers, `list_append` takes lists, `ADD` takes a number or a set, `DELETE` takes a set; a placeholder of the wrong type is refused with the service's type vocabulary (`S`, `N`, `L` for operators and functions; `STRING`, `NUMBER`, `Binary`, `BOOL`, `NULL`, `LIST`, `MAP` for ADD and DELETE). Function names are case-sensitive: `IF_NOT_EXISTS(x, :v)` and `foo(x)` are `Invalid function name`, a condition function is `not allowed in an update expression`, `list_append` is refused as an operand of a function or of `+`, both functions take two operands, the first operand of `if_not_exists` is a document path. A repeated section is reported after that section's own actions (`SET a = :v SET b = :q` reports `:q`). Previously `IF_NOT_EXISTS`, `DELETE s :string`, and `SET a = :string + :n` were accepted and written. - ConditionExpression and FilterExpression: the six condition functions are matched as written (`ATTRIBUTE_EXISTS(pk)` was accepted and evaluated); `if_not_exists` and `list_append` are `not allowed in a condition expression`; a boolean function in operand position and `size` in condition position are `not allowed to be used this way`; operand counts are fixed per function; `attribute_exists` and `attribute_not_exists` take a document path; `begins_with` takes a string or binary and `attribute_type` a string naming a type, both checked at request time with the operation's prefix. - Every unused name or value is listed in one set, sorted, so the message is the same on every backend; it named one key chosen by hash order. Request stage on the read APIs. Query and Scan check the FilterExpression, then the KeyConditionExpression (with its `Invalid KeyConditionExpression:` prefix, and ahead of the key schema match, so an undefined `#n` is reported as such), then the ProjectionExpression, then unused names and values, all before the table is looked up. An undefined `:q` in a filter returned 200 on an empty table. Limit and Segment checks precede the expressions on Scan. Single-item order. UpdateItem checks the whole ConditionExpression before the UpdateExpression. PutItem, UpdateItem, and DeleteItem wrap every expression-stage error in `1 validation error detected: ` and omit the `: ConditionExpression is null` suffix; the read, batch, and transaction APIs return the messages bare. The ` expression size: N` suffix follows the operation. Three existing dual-target tests asserted the unprefixed text and fail against the service; they are corrected. Transactions. TransactGetItems and TransactWriteItems validate in phases, each over every item before the next: per item, expressions (UpdateExpression before ConditionExpression), unused names and values, then the item's 400 KB size; then table lookup; then the 4 MB total; then key schema, as a cancellation with ValidationError on the first offending item only and None on every other (it flagged every offender); then duplicates. An undefined reference is the request error the service returns rather than a per-item cancellation reason, and a key schema mismatch leaves other items' conditions unevaluated. TransactWriteItems returns `"ItemCollectionMetrics": {}` when SIZE is requested and no table has a local secondary index, and its ConsumedCapacity entries are in first-appearance order rather than per-process hash order. Key-shaped messages. GetItem, DeleteItem, UpdateItem, BatchGetItem, and BatchWriteItem (Put and Delete) refuse a key with a missing, mistyped, or extra attribute with `The provided key element does not match the schema`; PutItem keeps `Missing the key pk in the item` and `Type mismatch for key`. BatchWriteItem returns `"ItemCollectionMetrics": {}` under SIZE with no LSI. Table ARNs in `TableName` (eight #108 rows) stay unsupported by decision: an ExtendDB table ARN names ExtendDB's account and region, so a table that streams or replicates to Amazon DynamoDB would answer to two ARNs. docs/differences-from-dynamodb.md records this. Remaining #108 gaps after this change, all stated in the PR: the parser's syntax wording (`Syntax error; token: X, near: Y`), the ResourceNotFound message text, the 4 MB message (the service's carries its own payload size), the service's rendering of over-limit list values, and the table ARN rows. Testing: tests/test_transact_validation_order.py (31 cases), tests/test_update_expression_rules.py (37), and tests/test_expression_semantics.py (155) pass against the service and on SQLite, PostgreSQL, and MongoDB; 164 of the 186 cases in the first and third fail on main. The expression, validation, transaction, batch, query, and scan suites pass on all three backends (767 on SQLite and PostgreSQL, 751 on MongoDB with the four #387 cases unchanged). Of the 106 #108 rows, 83 now return the service's status, error type, and message (30 on main). cargo test --workspace 1,500 passed; fmt; clippy -D warnings on 1.97.0; cargo +1.88.0 check. Closes part of #108.
Main is at 89fc971, four commits after the last merge (#690, #765, #774 and #1280). One file conflicted: the docstring of tests/test_expression_param_usage.py. #765 states that the values message of a Scan or a Query whose AttributeValues parse has no suffix. This branch adds the wrapped messages of the single-item writes. The merge keeps both statements. #765 also passes no expression parameters to the values check in handle_scan, which merged clean. So the row of tests/test_expression_semantics.py that sends a Scan with a ProjectionExpression and ExpressionAttributeValues now expects the message with no suffix. The service answered that request with the same message, on a table that does not exist, on 24 November 2026, each request sent twice.
|
Thanks for the approval, @jcshepherd. After it, ten PRs merged into main, and two of them, #526 and #765, conflicted with this branch. Since then the branch has two new commits, 7efa519 and a942b74. Both are merges of main. a942b74 also changes one test row. #765 dropped the The description lists the conflicts and the test runs. CI passed all 64 checks. Could you approve it again? |
Main is at 3534c9e, one commit after the last merge (#1009, the WebAssembly build). One file conflicted: crates/engine/src/lib.rs. In the module list, this branch adds attribute_updates and per_table_capacity, and #1009 puts a wasm32 cfg on backup and private_fs and adds pre_dispatch. The merge keeps all of them in name order, with each cfg and comment of #1009 above its module. Main changed two other files that this branch changes, and git merged them with no overlap. crates/core/src/limits/mod.rs gains page_size. The Limit conversion in crates/storage-sqlite/src/data/query_scan.rs saturates where usize is 32 bits.
The WebAssembly job builds extenddb-engine without its partiql feature. The workspace depends on the engine with default-features = false, and the wasm adapter does not enable partiql. On this branch, strip_single_item_write_prefix and parse_update_expr have callers only in the PartiQL module. So that build reports both as never used, and the clippy step of the job fails with -D warnings. Both now carry #[cfg_attr(not(feature = "partiql"), allow(dead_code))], as int32_member::read does on main. A build with the feature does not change.
Main is at 80490c6, eight commits after the last merge (#596, #1173, #398, #428, #544, #567, #584 and #588). One file conflicted: crates/engine/src/query.rs. #544 moves the Limit check and the parameter mix check of Query into validate_query_request_body, which reads the raw body before deserialization. This branch moves the same two checks to the start of the handler, after deserialization. The merge keeps the checks of #544 and drops the copies of this branch, which no request can reach. It keeps has_cond_op for the ConditionalOperator check. The conflict hunks in handle_query: - At the old Limit check, both sides remove the check. The merge keeps the comment of #544. - Next, this branch keeps the variables of the mix check, and main keeps the index key schema. The merge keeps the key schema where this branch has it. It drops the mix check variables, which nothing reads now, and keeps the comment of #544 and has_cond_op. - Before the ExclusiveStartKey check, this branch removes the filter operand checks, because its semantic pass runs them at parse time. #544 adds validate_key_condition_types there. The merge keeps the type check and drops the filter checks. #544 refuses a begins_with value that is not an S or a B ahead of an unused value (rows q5 and p4 of tests/test_query_key_value_types.py, measured 2026-11-06). This branch checks unused values before the table lookup, so the merged code gave the unused value message for those two rows. The merge calls refuse_begins_with_on_number after the key condition parse and removes the later call. The values of legacy KeyConditions pass validate_legacy_conditions before that point. Git merged four other files that both sides change, with no overlap: crates/core/src/expression/key_condition.rs, crates/engine/src/lib.rs, crates/storage-cassandra/tests/common/mod.rs and docs/differences-from-dynamodb.md.
…te tests #544 adds a TableKeyInfo literal to the test context of crates/engine/src/query_gate_tests.rs. This branch adds the creation_date_time field to TableKeyInfo, so the engine tests do not compile after the merge of main at 80490c6. The literal now sets creation_date_time to 0.0, as the other test literals on this branch do.
…te tests #544 adds a TableKeyInfo literal to the test context of crates/engine/src/query_gate_tests.rs. The commits of #399 on this branch add the creation_date_time field to TableKeyInfo. So the engine tests do not compile after the merge of main at 80490c6. The literal now sets creation_date_time to 0.0, as the other test literals on this branch do.
|
The order DynamoDB checks an UpdateItem and a TransactWriteItems Update in, measured in us-east-1 on 25 November and 1 December 2026, each request sent twice with the same answer both times. The 1 December requests went to a table that the principal may not write, so those refusals come ahead of the IAM decision and of the table lookup.
UpdateItem puts |
Main is at c057660, 35 commits after the last merge (80490c6). Three files conflicted. crates/engine/src/expression_helpers.rs: #1449 moved check_expression_size from this file to crates/core/src/expression/kind.rs. This branch adds check_expression_size_with, which takes the length suffix from the caller, and check_expression_size calls it. The merge puts check_expression_size_with in kind.rs beside check_expression_size, which now calls it, and exports it from extenddb_core::expression. The engine copies of both functions go, so the size check and its message stay in one place. The import list is the list of this branch with the two size checks added. crates/core/src/expression/mod.rs: in the module list, #1449 adds search_filter and search_params, and this branch adds semantics. The merge keeps all three in name order. docs/differences-from-dynamodb.md: this branch adds the row on a table ARN in TableName, and #1411 adds two rows on a DELETING table at the same place. The merge keeps the three rows. Git merged 13 other files that both sides change, with no overlap. In crates/engine/src/query.rs, #481 adds the key size check and moves the Select index check after the ExclusiveStartKey checks. Both checks come after the request-stage checks and the table lookup of this branch. In core, the other files are crates/core/src/expression/evaluator.rs and its tests, and crates/core/src/validation/mod.rs. In the engine, they are crates/engine/src/lib.rs, crates/engine/src/partiql/mod.rs and the two transaction files. In the storage crates, they are crates/storage-cassandra/src/backup_engine.rs, crates/storage-mongodb/src/table_engine.rs, the ddl.rs files of the PostgreSQL and SQLite crates, and crates/storage-sqlite/src/data/query_scan.rs.
…ests #481 adds crates/engine/src/query_key_size_tests.rs, whose run helper parses each key condition with parse_key_condition_expr and gives it only the expression and the limits. On this branch that function also takes the expression maps. It refuses a #name or :value that the request does not define. So the engine tests did not compile after the merge of main at c057660. The helper now builds the maps first. Every placeholder of the tests is in them, so each row still reaches the size check.
…n checks The breaking changes of this branch had no entry in the upgrade manual. The new v1.2.0 entry comes after main's v1.2.0 entries and lists them: - the requests that 1.1.0 served and ExtendDB now refuses - the updates that ExtendDB refuses before it reads the table - the prefix of the single-item writes and the key-shaped message - the legacy condition and AttributeUpdates checks - the transaction phases, ItemCollectionMetrics and the ConsumedCapacity order - the Scan segment order and PartiQL It also names the MongoDB tables that an earlier release created. Their creation time keeps whole seconds, so two of them created in the same second come in name order in ConsumedCapacity.
|
@eliseong I sent your shapes again on 3 December, in us-east-1, to tables that don't exist. I sent 19 shapes, each twice, and both sends gave the same answer unless I say otherwise below. The answers of #399 below are at edb464c.
The prefix: on #399, UpdateItem puts |
Main is at 44a7b79, five commits past c057660: #1531, #1466, #1087, #768 and #1296. In docs/manuals/07-upgrade-manual.md, #1531 adds a v1.2.0 entry at the top of "Behavior Changes by Release", and git merged it with no conflict. #1087 adds its v1.2.0 entry after the other v1.2.0 entries of main, where this branch has its entry. That is the one conflict. The merge keeps both entries without change: the entry of #1087 first, then the entry of this branch, before the v1.1.0 entries. Git merged crates/storage-sqlite/src/data/query_scan.rs with no conflict. #1087 replaces the rowid rule of the parallel Scan with the SQL function extenddb_scan_segment. It computes the segment of a start key from the key alone. This branch sets creation_date_time in the TableKeyInfo of the test helper key_info. The tests that #1087 adds in crates/storage-sqlite/src/scan_segment_tests.rs build each TableKeyInfo from a clone, so they need no change for the new field.
Changes since the last review
jcshepherd approved 2d137cc on 23 November. After that, 59 PRs merged into
main, up to 44a7b79. Seven of them conflicted with this branch: #526, #765, #1009, #544, #1449, #1411 and #1087. Since the approval the branch has ten new commits. Six mergemain, one fixes the WebAssembly build ofmain, two fix the engine tests after a merge, and one adds the upgrade manual entry:beafa78 merges
mainat 44a7b79, which adds fix(storage-cassandra): retry a lost UpdateItem version check over the PutItem and DeleteItem window #1531, ci(release): add devtools/freeze-migrations #1466, fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087, fix(bin): rerun the build script when the checked-out commit changes #768 and fix(server): ignore a TableName sent to an operation without one #1296. Indocs/manuals/07-upgrade-manual.md, fix(storage-cassandra): retry a lost UpdateItem version check over the PutItem and DeleteItem window #1531 adds a v1.2.0 entry at the top of "Behavior Changes by Release", and git merged it with no conflict. fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087 adds its v1.2.0 entry after the other v1.2.0 entries ofmain, where this PR has its entry. That is the one conflict. The merge keeps both entries without change: the entry of fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087 first, then the entry of this PR, above the v1.1.0 entries. Git mergedcrates/storage-sqlite/src/data/query_scan.rswith no conflict. fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087 replaces the rowid rule of the parallel Scan with the SQL functionextenddb_scan_segment. This PR setscreation_date_timein theTableKeyInfoof the test helperkey_infoof that file. The tests that fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087 adds incrates/storage-sqlite/src/scan_segment_tests.rsbuild eachTableKeyInfofrom a clone, so they need no change for the new field. The lines that this PR changes againstmainare the same before and after the merge. The gates on beafa78:cargo +1.97.0 fmt --all -- --checkis clean. The two clippy commands of.github/workflows/clippy.ymlwith-D warnings, on the whole workspace as CI runs them, are clean.extenddb-core1273 passed and 1 ignored,extenddb-engine991,extenddb-storage-cassandra194,extenddb-storage-mongodb197 and 86 ignored (on a replica set),extenddb-storage-postgres94, andextenddb-storage-sqlite336 and 1 ignored. The twobackup_catalog::write_lock_testsofextenddb-storage-sqlitefail on this host, as onmain(storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414).cargo test -p extenddb-wasm-adapterpasses, with itsparitycorpus test.cargo test -p extenddb-storage-postgres --test doc_version_literalspasses.--no-default-features --features sqlite) and a PostgreSQL server built from beafa78 on 127.0.0.1, the eleven wire files of this PR passed 446 tests on each. fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087 changes the SQLite Scan segments and this PR changes Scan code, so the Scan files ran too.tests/test_query_scan.py,tests/test_scan_segments.py,tests/test_read_paging.py,tests/python/test_query_scan.pyandtests/python/test_scan_edge_cases.pypassed 220 tests on each server.python3 -m pytest --collect-only -qcollects 7712 tests intests/and 820 intests/pythonwith no error.edb464c adds the v1.2.0 entry of this PR to
docs/manuals/07-upgrade-manual.md, after the v1.2.0 entries ofmain. The entry describes the changes that the Breaking changes section lists. It also names the MongoDB tables that an earlier release created. Their creation time keeps whole seconds, so two of them created in the same second come in name order inConsumedCapacity.caf3462 passes the expression maps to
parse_key_condition_exprincrates/engine/src/query_key_size_tests.rs, which fix(query): refuse key condition values over the key size limits #481 adds. On this branch the function takes the maps, because it refuses a#nameor:valuethat the request does not define. So the engine tests did not compile after the merge of 1fbf065.1fbf065 merges
mainat c057660, which adds 35 PRs. Three files conflicted:crates/engine/src/expression_helpers.rs: feat: SearchVectors inequality filters #1449 movedcheck_expression_sizetocrates/core/src/expression/kind.rs. This branch addscheck_expression_size_withbeside it, which takes the length suffix from the caller. The merge putscheck_expression_size_withinkind.rs, andcheck_expression_sizecalls it, so the size check and its message have one copy.crates/core/src/expression/mod.rs: the module list keepssearch_filterandsearch_paramsof feat: SearchVectors inequality filters #1449 andsemanticsof this branch.docs/differences-from-dynamodb.md: the table keeps the table ARN row of this branch and the two rows of fix(engine): describe a DELETING table with the members the service keeps #1411 on a DELETING table.In
crates/engine/src/query.rs, fix(query): refuse key condition values over the key size limits #481 adds the key size check and moves the Select index check after the ExclusiveStartKey checks. Git merged the file with no conflict, and both checks come after the request-stage checks and the table lookup of this branch.At edb464c, this PR's diff over
mainis 69 files with 6118 lines added and 967 removed. Its added and removed lines are the same as before the merge in 64 files. They differ inmod.rsandexpression_helpers.rsof the merge, inkind.rs, in the test file of caf3462 and in the upgrade manual.1a93ee2 sets
creation_date_timein theTableKeyInfoliteral that fix(query): check Query values against the key schema and the number rules #544 adds tocrates/engine/src/query_gate_tests.rs. This branch adds that field, so the engine tests did not compile after the merge of 5a2facf. At 1a93ee2, this PR's diff overmainwas 66 files with 6084 lines added and 963 removed.5a2facf merges
mainat 80490c6, which adds UpdateExpression ADD creates no missing map on its path #596, fix(storage-cassandra): extenddb destroy removes only a deployment's own keyspaces #1173, fix(metrics): bound latency segment memory by summing into fixed time buckets #398, docs(design): describe the query cursor as the row comparison the code emits #428, fix(query): check Query values against the key schema and the number rules #544, fix(expression): report a character outside the grammar without closing the connection #567, docs: describe the PostgreSQL read replica mode as a proposal #584 and fix(query): bound begins_with on a string sort key by the next prefix #588. One file conflicted:crates/engine/src/query.rs, with fix(query): check Query values against the key schema and the number rules #544. fix(query): check Query values against the key schema and the number rules #544 checksLimitand the parameter mix of Query invalidate_query_request_body, on the raw body before deserialization. This branch has the same two checks after deserialization, so the merge keeps the checks of fix(query): check Query values against the key schema and the number rules #544 and drops the copies of this branch. It keeps the table lookup, the index lookup and the index key schema where this branch has them, below the request-stage checks. The comments of fix(query): check Query values against the key schema and the number rules #544 take the place of the two checks. Before the start key check, it keeps thevalidate_key_condition_typescall that fix(query): check Query values against the key schema and the number rules #544 adds. It drops the filter operand checks there, because the semantic pass of this branch runs them at parse time. fix(query): check Query values against the key schema and the number rules #544 refuses abegins_withvalue that is not an S or a B ahead of an unused value (measured 2026-11-06). This branch checks unused values before the table lookup, so on the merged tree rows q5 and p4 oftests/test_query_key_value_types.pygot the unused value message. The merge callsrefuse_begins_with_on_numberright after the key condition parse, before the table lookup, and removes the later call.7efa519 merges
mainat b3c54f6, which adds test(backup): wait for the restore's ACTIVE line in the server log #1159, test(storage-sqlite): skip a file that goes between the listing and the read #1113, fix(storage): plan an LSI query as an index walk on PostgreSQL and SQLite #432, feat(streams): AT_TIMESTAMP shard iterator on all four backends #468, fix(sqlite): render the stream retention cutoff in the created_at column shape #503 and fix(engine): compare the Return fields on a TransactWriteItems token replay #526. fix(engine): compare the Return fields on a TransactWriteItems token replay #526 and this branch change theuselists at the top ofcrates/engine/src/transact_write_helpers.rsandcrates/engine/src/transact_write_items.rs. The merge keeps every name that either side uses.a942b74 merges
mainat 89fc971, which adds fix: match data relations by catalog id in catalog-check, so --fix keeps live tables #690, fix(scan): drop the FilterExpression suffix from the values message #765, fix(server): send Message on the two errors the service sends it on #774 and test(storage-mongodb): end the killed holder's lease by data, not by waiting #1280. The one conflict was in the docstring oftests/test_expression_param_usage.py. The merge keeps the sentence of fix(scan): drop the FilterExpression suffix from the values message #765 on Query and Scan and the sentence of this branch on PutItem, UpdateItem and DeleteItem.cdafc6f merges
mainat 3534c9e, which adds feat(wasm): [Add WebAssembly browser support for ExtendDB #1009 (the WebAssembly build). The one conflict was in the module list ofcrates/engine/src/lib.rs. This branch addsattribute_updatesandper_table_capacity, and feat(wasm): [Add WebAssembly browser support for ExtendDB #1009 addspre_dispatchand puts a wasm32cfgonbackupandprivate_fs. The merge keeps all of them. At cdafc6f, this PR's own diff overmainwas the same as before that merge, 65 files with 6108 lines added and 996 removed.5ee0b6d puts
#[cfg_attr(not(feature = "partiql"), allow(dead_code))]onstrip_single_item_write_prefixandparse_update_exprincrates/engine/src/expression_helpers.rs, asint32_member::readhas it onmain. The WebAssembly job of feat(wasm): [Add WebAssembly browser support for ExtendDB #1009 buildsextenddb-enginewithout itspartiqlfeature. On this branch only the PartiQL module calls those two functions, so at cdafc6f that build reported both as never used, and the job failed. With the feature on, the attribute has no effect.#765 dropped the
: FilterExpression is nullsuffix from the Scan values message. In a942b74, the Scan row oftests/test_expression_semantics.pywith aProjectionExpressionandExpressionAttributeValuesnow expects the message with no suffix. The service gave that request the same message on 2026-11-24, on a table that does not exist, two sends each. Known differences no longer lists this message.At 5ee0b6d,
cargo fmt --checkis clean, and clippy with-D warningsis clean onextenddb-enginewith and without itspartiqlfeature, onextenddb-engineforwasm32-unknown-unknownwith the WebAssembly job's clippy configuration, and onextenddb-wasm-adapter. At cdafc6f, both clippy commands of.github/workflows/clippy.ymlwith-D warningsare clean on the whole workspace. The core lib tests give 1174 passed and 1 ignored, and the engine lib tests give 900 passed. On a SQLite server built from cdafc6f, the eleven test files that this PR adds or changes andtests/test_error_message_key.pyofmaingive 450 passed. Testing done gives the commands.The Transactions section now lists the checks of each item in the order that this PR runs them. It also gives the order that the service measured for the two expressions of an Update.
Testing done gives the runs at edb464c, the head before beafa78. The first bullet above gives the gates at beafa78.
What
Issue #108 lists 106 requests whose response differs from Amazon DynamoDB. This change makes ExtendDB check expressions and transactions in the service's order. For the groups below, ExtendDB now returns the service's messages. Every expectation was measured against the service in us-east-1, on the dates that Testing done lists. Every new test file was run against the service before it was run against ExtendDB.
Semantic checks of expressions
After the grammar pass, the service walks the parsed expression once, in expression order. It checks each node after its operands. Then it checks overlapping paths, and then the unused names and values. The new
validate_update_semanticsandvalidate_condition_semanticsincrates/core/src/expression/semantics/follow that walk, with one file per rule family. The parsers now do grammar only. They keep function names as written and record the section order for the walk.+and-take numbers,list_appendtakes lists,ADDtakes a number or a set, andDELETEtakes a set. ExtendDB refuses a placeholder of the wrong type with the service's type names. Operators and functions nameS,NorL.ADDandDELETEnameSTRING,NUMBER,Binary,BOOL,NULL,LISTorMAP, and the message ends with the allowed set of the operator,typeSet: ALLOWED_FOR_ADD_OPERANDortypeSet: ALLOWED_FOR_DELETE_OPERAND(39ad6cd, measured 2026-11-16).IF_NOT_EXISTS(x, :v)andfoo(x)getInvalid function name. A condition function getsnot allowed in an update expression. ExtendDB refuseslist_appendas an operand of a function or of+. Both update functions take two operands, and the first operand ofif_not_existsis a document path.SET a = :v SET b = :qreports:q.IF_NOT_EXISTS(x, :v), and it acceptedDELETE s :stringwhensdid not exist. ExtendDB already refusedSET a = :string + :nwhen it evaluated the update (An operand in the update expression has an incorrect data type). It now refuses it before it reads the table, with the service's text.ATTRIBUTE_EXISTS(pk).if_not_existsandlist_appendin a condition getnot allowed in a condition expression. A boolean function in operand position, andsizein condition position, getnot allowed to be used this way.attribute_existsandattribute_not_existstake a document path.begins_withtakes a string or binary, andattribute_typetakes a string that names a type. ExtendDB checks both at request time, with the prefix of the operation.Legacy conditions
ScanFilter, QueryFilter and KeyConditions bypass the expression parser. So they get their own request-time check, ahead of the desugaring and the table lookup. Its rules were measured against the service on 2026-10-23 for every ComparisonOperator and AttributeValue type. The check covers:
Invalid comparison operatorInvalid number of argument(s) for the <op> ComparisonOperatorComparisonOperator <op> is not valid for <type> AttributeValue typeEach message has the
One or more parameter values were invalid:prefix. ExtendDB refuses a range key operator that the service does not index (NE, NULL, NOT_NULL, CONTAINS, NOT_CONTAINS, IN) in KeyConditions withAttempted conditional constraint is not an indexable operation. Before this change, a ScanFilter with BEGINS_WITH and a number returned 200 on an empty table.The BETWEEN bound check reads each bound with the
number_valueofmain(#620), ascomparison_numberdoes (a0f2a6b). For a bound that the number check refuses,compare_orderablereturns None, as it does for a value that is not a number. The range check then does not refuse the request.Request stage on the read APIs
Query and Scan check the FilterExpression first. The KeyConditionExpression comes next, with its
Invalid KeyConditionExpression:prefix and ahead of the key schema match, so an undefined#ngets the undefined name message. Query refuses abegins_withkey condition value that is not an S or a B right after that parse. Then come the ProjectionExpression and the unused names and values. All of these come before the table lookup. Before this change, an undefined:qin a filter returned 200 on an empty table.A function in a
KeyConditionExpressiongets a message that depends on its name:contains,attribute_exists,attribute_not_existsandattribute_typegetInvalid operator used in KeyConditionExpression, with no function name.sizegetsKeyConditionExpressions cannot contain nested operations.Begins_Withincluded, getsInvalid function name; function: <name>.The message names the first undefined
#nameor:valuein the text, whether a name or a value comes first. ALimitunder 1 on Query and Scan gets1 validation error detected: Value at 'Limit' failed to satisfy constraint: Member must have value greater than or equal to 1. That check comes ahead of the table lookup and every expression.On Scan, the range checks on
SegmentandTotalSegmentsalso come ahead of the expressions. The checks that the two go together, and thatSegmentis belowTotalSegments, come after the expressions and the unused names and values. They come before the table lookup. #558, #562 and #850 hold their own copies of these Scan range checks, and #507 holds this copy through its merge of this branch. #850 has the service's texts for them. When one of these PRs merges, each PR that merges after it drops its own copy and uses the copy onmain.Single-item order
UpdateItem checks the whole ConditionExpression before the UpdateExpression. PutItem, UpdateItem and DeleteItem wrap every expression-stage error in
1 validation error detected:and omit the: ConditionExpression is nullsuffix. The read, batch and transaction APIs return the messages bare. Theexpression size: Nsuffix depends on the operation. A Scan FilterExpression and a transaction ConditionExpression have it, and a Query FilterExpression and the single-item ConditionExpression do not.Eleven assertions in three existing dual-target test files expected the unprefixed text, and they fail against the service. There are 3 in
test_expression_error_prefix.py, 6 intest_expression_param_usage.pyand 2 intest_expression_size_limit.py. This PR fixes them and adds one assertion to the third file.Legacy
AttributeUpdatesget a request-time check of the value types, ahead of the table lookup and the key checks. AnADDof a value that is not a number or a set gets1 validation error detected: One or more parameter values were invalid: ADD action is not supported for the type S. AnADDof a list gets the same text withtype L. The service passes that request to the table lookup (Known differences, item 13). ADELETEwith a value that is not a set gets... DELETE action with value is not supported for the type N. AConditionCheckwith an emptyConditionExpressiongetsInvalid ConditionExpression: The expression can not be empty;.Transactions
TransactGetItems and TransactWriteItems check in phases, and each phase covers every item before the next phase starts. Before the table lookup, TransactWriteItems checks each item in turn:
ExpressionAttributeValues(for a Put or a Delete, only with a ConditionExpression), then in the key or in the item of a PutExpressionAttributeValuesof the item (32 wrappers pass, 33 do not)The service checks the ConditionExpression of an Update before its UpdateExpression, as UpdateItem does (measured 2026-11-12 and 2026-12-03). On 2026-10-14 it answered the UpdateExpression first. This PR keeps that order, and
test_transaction_checks_the_update_firstexpects it. #597, which sits on this PR, checks the condition first in 617ab86.Then come the table lookup and the 4 MB total. Then one pass over the items in order stops at the first failing item. It checks a key that does not fit the schema, then a key attribute named in an Update, then an empty key value. The first two give a cancellation with
ValidationErroron that item andNoneon every other item. The third gives a top-level ValidationException.Duplicate targets come next. Last comes an Update that stores a value nested deeper than an item may hold, which gets a
ValidationErrorreason on every such item. TransactGetItems checks the projections, then does the table lookup, then checks the key schema (first offending item only), and then checks for duplicate keys. As on the service, an undefined reference fails the request instead of giving a cancellation reason per item. A key schema mismatch leaves the conditions of the other items unevaluated.TransactWriteItems returns
"ItemCollectionMetrics": {}when the request asks for SIZE and no table has a local secondary index (LSI). The ConsumedCapacity entries of both transaction APIs are in table creation order, oldest first, as measured on the service (section below).Key-shaped messages
GetItem, DeleteItem, UpdateItem, BatchGetItem and BatchWriteItem (Put and Delete) refuse a key with a missing, mistyped or extra attribute. The message is
The provided key element does not match the schema. PutItem keepsMissing the key pk in the itemandType mismatch for key. BatchWriteItem returns"ItemCollectionMetrics": {}under SIZE with no LSI.Table ARNs
Table Amazon Resource Names (ARNs) in
TableName(eight #108 rows) stay unsupported by decision. An ExtendDB table ARN names the account and region of ExtendDB. So a table that streams or replicates to Amazon DynamoDB would answer to two ARNs.docs/differences-from-dynamodb.mdrecords this. Open PR #200 takes the opposite position, and the two PRs need one decision before either merges.PartiQL
ExecuteStatement runs a statement as the classic request above. So the statement gets the same refusals, without the expression prefix. The answers of
mainin this section come from a SQLite server built from 1d3be63. The answers of this branch come from a SQLite server built from 2d137cc plus the fix of Known differences item 13. That fix changes only the legacyAttributeUpdatespath, which PartiQL does not use. The service's answers to these statements are not measured.For example,
SELECT * FROM "t" WHERE pk = 'k' AND attribute_type(b, 'XX')returned 200 with no items onmain. On this branch it getsInvalid attribute type name found; type: XX, valid types: {S,SS,N,NS,B,BS,BOOL,NULL,L,M}. The diff also changes four PartiQL paths:partiql::bare_expression_erroralso drops the1 validation error detected:that UpdateItem now puts in front of an expression-stage message. So a statement keeps the text it had onmain.UPDATE "t" SET a = 1 SET a = 2 WHERE pk = 'k'getsTwo document paths overlap with each other; must remove or rewrite one of these paths; path one: [a], path two: [a]on both.partiql/item_depth.rshandles anUPDATEthat sets a value 32 levels deep. It now checks the whole condition, syntax and then semantics, before the update expression, as UpdateItem does. With a 32-level?,UPDATE "t" SET a = ? WHERE pk = 'k' AND attribute_type(b, 'XX')gotConditionalCheckFailedExceptiononmain. It now gets aValidationExceptionwith theInvalid attribute type name foundtext above. In ExecuteTransaction,maincancelled the same statement withConditionalCheckFailed. This branch answers aValidationExceptionInvalid ConditionExpression: Invalid attribute type name found; ..., with the prefix, with or without the 32-level value.partiql/base_join.rshandles a read of an LSI that reads each item back from the table. It now runs the semantic pass on its filter before it reads the index.SELECT b FROM "t"."lsi" WHERE pk = 'k' AND attribute_type(lk, 'XX')returned 200 with no items onmain. It now gets theInvalid attribute type name foundtext.partiql/batch.rsnow expectsUPDATE "t" SET a = list_append(l, 1) WHERE pk = 'k'to translate. UpdateItem refuses it when the statement runs. ExecuteStatement now answersIncorrect operand type for operator or function; operator or function: list_append, operand type: N. Onmainit answeredAn operand in the update expression has an incorrect data type. In BatchExecuteStatement the statement gets the same two texts as aValidationError.Commits
This is one PR with three pieces that can be read on their own:
legacy_filter.rs,legacy_filter_tests.rs, and the 79 wire cases intests/test_expr_operand_type_and_size.py.creation_date_timefield onTableKeyInfoand the column read in the SQLite, PostgreSQL and Cassandra storage crates. They also add the MongoDB catalog write that keeps milliseconds, andtests/test_transact_capacity_order.py.TableNameunsupported is one row indocs/differences-from-dynamodb.md, added in 29229c2 with the semantic pass.Commits ac76c66 and 964f3c3 only move code: the semantic pass split by rule family, and the update parser tests into their own file. The six commits from af5f681 to cbb04f0 change the transaction phases, the Query key condition checks, four request stage texts and the Scan parameter order. They add tests for each.
The commits after 1454cc9:
creation_date_timein twoTableKeyInfoliterals thatmainadded in test code.number_value(Legacy conditions above).max_expression_depthto the update section parse inparse_update_expr_checked. So UpdateItem, TransactWriteItems and the PartiQL item depth check keep the depth limit of fix(core): bound the nesting depth of update expressions #1000.Why
Refs #108. This PR fixes some of its groups, and the list below gives the groups that remain.
A client that maps on the error codes and messages of the service saw different responses from ExtendDB on these requests. So did a client that reads
CancellationReasons,ItemCollectionMetricsorConsumedCapacity. ExtendDB also accepted request shapes that the service refuses:DELETEof a string on an absent attributelist_appendif_not_existswhose first operand is not a pathOn 2026-10-14, before the legacy condition work above, this branch was measured on the 106 rows in #108. It returned the status, error type and message of the service for 83 rows, and
maindid so for 30. The rows that remained are in these groups:Syntax error; token: X, near: Y, 13 rows)ResourceNotFoundmessage text (3 rows)1 validation error detectedmessage of the service (2 rows: 101 transaction items, 26 batch writes)The 4 MB transaction message also remains: the text of the service carries its own serialized payload size.
ConsumedCapacity order per backend
TransactGetItems and TransactWriteItems return one ConsumedCapacity entry per table, in table creation order, oldest first. Two tables with the same stored creation time come in name order.
The precision of the stored creation time differs per backend, so the point at which two creates tie differs with it:
f64of epoch seconds.The order was measured on SQLite, PostgreSQL and MongoDB. The six cases of
tests/test_transact_capacity_order.pyrun in CI on SQLite, PostgreSQL, MongoDB and Cassandra. At 2d137cc they passed on all four backends.Known differences
Items 1 to 8 are differences from the service on the legacy condition paths that this PR does not change. They were measured against the live service on 2026-10-23 and filed as #477. Since #429,
mainanswers items 5 and 7 with the message of the service for the key attributes of a table. The other six are present onmain.ComparisonOperator <op> is not valid for <type> AttributeValue type).Items 9 to 12 were measured against the live service on 2026-10-27 and are present on
main.ConditionExpressionon a transaction Put, Delete or Update, and on PutItem, UpdateItem or DeleteItem: the service answersInvalid ConditionExpression: The expression can not be empty;. ExtendDB treats it as no condition.Attribute name is too large, must be less than 65536 bytes, and ExtendDB words it differently. The boundary agrees.SegmentandTotalSegmentsrange checks: the service answersValue at 'TotalSegments' failed to satisfy constraint: ...andValue at 'Segment' .... ExtendDB uses another wording, and its text for aSegmentat or aboveTotalSegmentsends with the two values.ValidationErrornext toConditionalCheckFailed). ExtendDB reportsNonefor them.This PR adds the difference in item 13.
AttributeUpdatesADDof a list, with or without members: the request-time check of this PR refuses it with1 validation error detected: One or more parameter values were invalid: ADD action is not supported for the type L. On a table that does not exist, the service answersResourceNotFoundException(measured 2026-11-23, two sends each), and so doesmain. On a table that exists, the answer of the service is not measured. A second pull request, opened after this one merges, will fix this difference. With that change, the list will pass to the table lookup, as on the service.Merge of main at
381c8c78aThe #1000 change on
mainbounds the nesting depth of update expressions and ofsizecalls in conditions and filters. This branch parses every name followed by a parenthesis as a function call. So the merge counts one level for each call that is an operand, whatever its name. A call that is the whole condition counts none. Past the limit,cd502509bchecks the name of the call with the rule of the semantic pass. A name that the rule refuses gets that refusal. The service gives that refusal to 151, 200 and 300 nested calls (measured 2026-11-19, two sends each). Asizecall in a condition, andif_not_existsorlist_appendin a SET value, still answerexpression nesting depth exceeded. For a name thatmaindid not parse as a function,mainanswered a syntax error past the limit. #1155 lists three nests past the limit that still differ from the service.Rebase on main
The branch was rebased onto
mainat f49c5f8 on 31 October. The commit ids in this description are the ones on this head. The rebase resolved this branch against these PRs ofmain, and each resolution holds at this head:crates/core/src/expression/mod.rs: fix(auth): bind LeadingKeys for a refused Query's partition operand #511 widened thekey_conditionre-export toKeyClauseOperand,KeyCondition,SortKeyCondition,key_condition_clause_operandsandparse_key_condition. This branch addscompare_orderableto theevaluatorre-export, and the file keeps both lines. The rule of fix(auth): bind LeadingKeys for a refused Query's partition operand #511 is unchanged for every key condition that parses.begins_withwritten in another case no longer parses, so it binds no LeadingKeys, as for any condition that does not parse.crates/storage-cassandra/tests/direct/stream_ownership.rs: fix(streams): resolve the shard against its stream inside the GetRecords read #543 added this test after this branch gaveTableKeyInfoitscreation_date_timefield. So its oneTableKeyInfoliteral did not build. The commit that adds the field (68dcd0a) setscreation_date_time: 0.0there, as it does instreams.rs.crates/engine/src/query.rs: fix(query): classify and order key conditions on a multi-attribute GSI the way the service does #429 addedcheck_key_value_typeandrefuse_begins_with_on_numberabovevalidate_name_refs_in_expr. This branch deletesvalidate_name_refs_in_expr, because the semantic pass thatparse_condition_checkedruns on the filter replaces its one call. The file keeps the two functions of fix(query): classify and order key conditions on a multi-attribute GSI the way the service does #429. The key condition classification of fix(query): classify and order key conditions on a multi-attribute GSI the way the service does #429 inhandle_querysits where this branch moved the key condition handling. That is after the table and index lookup, and before the Select checks.After the rebase the branch merged
maintwelve times: 6f12515, 5646709, ba4ae3d, 1700595, 63c2ba9, 2d137cc, 7efa519, a942b74, cdafc6f, 5a2facf, 1fbf065 and beafa78, the last atmain44a7b79.Other open PRs
These are the conflicts of a dry merge (
git merge-tree) of beafa78 with the head of each of the 219 open PRs, on 4 December 2026. A merge ofmainwith the same head has none of them:docs/manuals/07-upgrade-manual.md: fix: answer requests during a table's DELETING window as the service does #550, fix(scan): check the numbers in ExpressionAttributeValues as the service does #562, fix: enforce the table quota, the provisioned-capacity maxima and max_policy_document_bytes #831, fix(engine): refuse ProjectionType and StreamViewType outside their sets #1110, fix(core): refuse a name that starts with an underscore in an expression #1131, fix(server): send Message on a SerializationException #1220, fix(server): write __type first in an error body #1249 and fix(core): send DynamoDB's text for a B value that does not decode #1260. Each of them puts its v1.2.0 entry after the v1.2.0 entries ofmain, where this PR puts its own. The PR that merges second keeps both entries. 23 other open PRs conflict with this PR there and withmainthere too.docs/differences-from-dynamodb.md: fix(mongodb): retry an unconditional PutItem that conflicts on a GSI table #487, docs: one install page per path, first requests page, container upgrades #523, docs: architecture dash sweep and one feature status owner #530, feat(core): throttle errors carry the service's ThrottlingReasons #532, feat(engine): serve a batch partially when a backend throttles some entries #536, docs: configuration reference generated from the sample file, pinned to the structs #537, feat(server): a request scope carries the request id to the engine's fault log lines #547, feat(server/app): thin-bin Extensions: HTTP routers and a request observer #549, fix: answer requests during a table's DELETING window as the service does #550, feat(server/app): console tabs a thin binary adds #557, feat: per-index throttle buckets for provisioned global secondary indexes #587, fix: answer TTL and tag calls during a table's DELETING window #599 and hitesh96db's fix(engine): count index writes in TransactWriteItems ConsumedCapacity #1574.crates/engine/src/batch_write_item.rs: feat(engine): serve a batch partially when a backend throttles some entries #536, feat(server): a request scope carries the request id to the engine's fault log lines #547, feat(server/app): thin-bin Extensions: HTTP routers and a request observer #549, feat(server/app): console tabs a thin binary adds #557 and feat: per-index throttle buckets for provisioned global secondary indexes #587.crates/storage-postgres/src/data/ddl.rs: fix: answer requests during a table's DELETING window as the service does #550, fix(cassandra): fence concurrent DeleteTable with a lease #598 and fix: answer TTL and tag calls during a table's DELETING window #599.crates/core/src/expression/parser.rsandupdate_parser.rs: fix(query): check legacy conditions against the key schema #507, fix(expression): operator cap, syntax error wording, PutItem map keys #558 and fix(mongodb): evaluate deeply nested conditions instead of answering 500 #571.update_parser.rsalone: fix(core): refuse the list indexes DynamoDB refuses in expression paths #1095.depth_tests.rs: fix(query): check legacy conditions against the key schema #507.crates/engine/src/query.rs: fix(expression): operator cap, syntax error wording, PutItem map keys #558, fix(mongodb): evaluate deeply nested conditions instead of answering 500 #571 and fix(core): refuse a name that starts with an underscore in an expression #1131.crates/engine/src/scan.rs: fix(expression): operator cap, syntax error wording, PutItem map keys #558, fix(scan): check the numbers in ExpressionAttributeValues as the service does #562, fix(mongodb): evaluate deeply nested conditions instead of answering 500 #571, fix(scan): report every Limit, Segment and TotalSegments range fault in the service's two forms #850 and fix(scan): check AttributesToGet, ScanFilter, ExclusiveStartKey and ExpressionAttributeValues in the service's order #854.crates/engine/src/query_gate_tests.rs: fix(scan): report every Limit, Segment and TotalSegments range fault in the service's two forms #850 and fix(scan): check AttributesToGet, ScanFilter, ExclusiveStartKey and ExpressionAttributeValues in the service's order #854.crates/engine/src/transact_write_items.rs: fix(query): check legacy conditions against the key schema #507, fix(engine): refuse a table name of a bad length before the lookup #1127, fix(server): count a table name in UTF-16 code units in four operations #1130, fix(core): refuse overlapping and conflicting UpdateExpression paths #1543 and fix(engine): count index writes in TransactWriteItems ConsumedCapacity #1574. fix(engine): count index writes in TransactWriteItems ConsumedCapacity #1574, opened on 3 December, counts index writes in theConsumedCapacityof TransactWriteItems. This PR orders those entries by table creation time.crates/core/src/expression/mod.rs: fix(core): refuse an update whose result nests beyond 32 levels #590, perf(postgres): write a create-only put in one autocommit statement #987 and fix(core): refuse overlapping and conflicting UpdateExpression paths #1543.crates/core/src/expression/resolver.rs: fix(core): refuse overlapping and conflicting UpdateExpression paths #1543.crates/core/src/validation/mod.rs: fix(core): refuse an update whose result nests beyond 32 levels #590 and fix: answer a wrong-typed key on GetItem, DeleteItem, UpdateItem and TransactGetItems with the schema message #826.crates/engine/src/update_item.rs: fix(core): refuse the list indexes DynamoDB refuses in expression paths #1095 and fix(core): refuse a name that starts with an underscore in an expression #1131.crates/engine/src/expression_helpers.rs: fix(core): refuse a name that starts with an underscore in an expression #1131.crates/engine/src/put_item.rs: feat: add StartBulkPutItems and the bulk operation APIs #874.Before the merge, the head of this PR conflicted with
mainincrates/core/src/expression/mod.rsandcrates/engine/src/expression_helpers.rs, and so with 68 other open PRs in those files. Those conflicts are gone.#1543 (eliseong) adds
validate_update_pathstocrates/core/src/expression/resolver.rs. It refuses overlapping and conflicting update paths in one check. This PR addsvalidate_update_paths_disjointto the same file for the overlap. The second of the two to merge keeps one check.#597 sits on this branch, and #1140 sits on #597.
Testing done
These runs are at edb464c, the head before beafa78 (the gates on beafa78 are in Changes since the last review):
cargo +1.97.0 fmt --all -- --checkis clean.cargo +1.97.0 clippy --locked --all-targets --features extenddb-storage-cassandra/test-hooks,extenddb-storage-mongodb/test-hooks -- -D warningsandcargo +1.97.0 clippy --locked --all-targets --features extenddb-engine/backup-test-hooks -- -D warningsare clean on the whole workspace.cargo +1.94.0 check --locked --all-targetsis clean onextenddb-core,extenddb-engineand the four storage crates. 1.94.0 is therust-versionof the workspace.cargo +1.97.0 test --locked --no-fail-fast --libruns on core, engine, the four storage crates andextenddb-server. Core gives 1273 passed and 1 ignored, and engine 991 passed. Cassandra gives 192 passed, MongoDB 197 passed and 86 ignored, and PostgreSQL 94 passed. SQLite gives 335 passed, 1 ignored and 2 failed, and the server gives 521 passed and 5 failed.backup_catalog::write_lock_testsof storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414. The 5 server failures arebackup_store::testswith the same cause. On the test host, an ancestor directory of the test paths belongs to another user, and the owner check refuses the path.cargo +1.97.0 test --locked -p extenddb-wasm-adapterpasses: 3 unit tests and theparitycorpus test..github/workflows/wasm.yml(devtools/run-wasm-step clippy) is clean on the branch. The test host has no clang, so two stand-ins take the C compile of the bundled SQLite. Clippy does not link.cargo +1.97.0 test --locked -p extenddb-storage-postgres --test doc_version_literalsgives 3 passed.--collect-onlyrun collects 7669 tests intests/and 820 intests/python, with no error.--no-default-features --features sqlite) and a PostgreSQL server from edb464c each pass 779 cases. These are the eleven wire files that this PR adds or changes (446 cases),tests/test_error_message_key.py(4) and the three Query wire files of fix(query): check Query values against the key schema and the number rules #544 (329). Each server also passes the 105 cases of the three Query key size files that fix(query): refuse key condition values over the key size limits #481 adds totests/python.These runs are at 5ee0b6d, the head before the merge of
mainat 80490c6:cargo +1.97.0 fmt --all -- --checkis clean.cargo +1.97.0 clippy --locked -p extenddb-engine --no-default-features --lib -- -D warningsandcargo +1.97.0 clippy --locked -p extenddb-engine --all-targets -- -D warningsare clean.CLIPPY_CONF_DIR=devtools/wasm-clippy cargo +1.97.0 clippy --locked -p extenddb-engine --no-default-features --lib --release --target wasm32-unknown-unknown -- -D warningsis clean.cargo +1.97.0 clippy --locked -p extenddb-wasm-adapter --all-targets -- -D warningsis clean..github/workflows/wasm.ymlcompile SQLite with clang, which the test host does not have. The WebAssembly CI job runs them.With the
partiqlfeature on, 5ee0b6d compiles the same code as cdafc6f. So these runs at cdafc6f also hold for 5ee0b6d:cargo +1.97.0 clippy --locked --all-targets --features extenddb-storage-cassandra/test-hooks,extenddb-storage-mongodb/test-hooks -- -D warningsandcargo +1.97.0 clippy --locked --all-targets --features extenddb-engine/backup-test-hooks -- -D warningsare clean on the whole workspace.cargo +1.97.0 test --locked -p extenddb-core -p extenddb-engine --lib: 1174 passed and 1 ignored in core, and 900 passed in engine.tests/test_error_message_key.pyofmaingive 450 passed.--collect-onlyrun collects 7002 tests intests/and 672 intests/python, with no error.These runs are at 2d137cc, the approved head. The head of this description is 2d137cc plus the ten commits that Changes since the last review lists.
run-tests (1.91.1)among them. At 2d137cc, 1.91.1 was therust-versionof the workspace.cargo +1.97.0 clippy -p extenddb-core -p extenddb-engine --lib -- -W clippy::pedanticgives 35 warnings on lines that this PR adds, 31 of themdoc_markdown. So the Clippy box below stays unticked.The eleven wire files pass on a SQLite server built from 2d137cc, 443 cases in all:
maintests/test_expression_semantics.py(new)tests/test_transact_validation_order.py(new)tests/test_update_expression_rules.py(new)tests/test_transact_write_phase_order.py(new)tests/test_request_stage_checks.py(new)tests/test_transact_value_nesting.py(new)tests/test_transact_capacity_order.py(new)tests/test_expr_operand_type_and_size.py(79 new cases)tests/test_expression_error_prefix.pytests/test_expression_param_usage.pytests/test_expression_size_limit.pyThe last column comes from a SQLite server built from
main(1d3be63), with the test files of 2d137cc. So 164 of the 190 cases in the first two files fail onmain. At a942b74,tests/test_expression_param_usage.pyhas 15 cases, because #765 madetest_scan_values_no_expressiona table of four cases.Measurements: the expected responses of the tests come from Amazon DynamoDB in us-east-1, on 2026-10-14, 2026-10-23, 2026-10-27, 2026-11-16, 2026-11-19 and 2026-11-24. The depth tests in
crates/core/src/expression/depth_tests.rsuse the measurement of 2026-11-19. The Scan row that a942b74 changes uses the measurement of 2026-11-24, on a table that does not exist, two sends each. Where the text of ExtendDB differs from the text of the service, the test checks part of the message. These are the known differences and the syntax wording rows.Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a. The change makes wire-visible error texts and response members match the live service. CONTRIBUTING lists such changes under the RFC trigger, but this PR is a parity fix measured against the service and proposes no new protocol.
Breaking changes
ExtendDB now refuses requests that the service refuses and that ExtendDB accepted:
DELETEof a value that is not a set on an absent attributelist_appendif_not_existswhose first operand is not a path:valueor#namein a Query or Scan filter, which returned 200 when ExtendDB evaluated no rowBefore this change, only the evaluation refused the requests below. ExtendDB now refuses them before it reads the table, with the text of the service:
+or-on a placeholder that is not a numberADDof a wrong typelist_appendof a value that is not a listBefore the table lookup, a legacy
AttributeUpdatesADDnow gets the legacy text for a value other than a number or a set. This includes anADDof a list, which the service passes to the table lookup (Known differences, item 13). A legacyDELETEwith a value that is not a set also gets the legacy text. A Scan withSegmentand noTotalSegmentsnow reports an expression error ahead of the missing parameter, as the service does.The error messages for these groups change to the text of the service. Key mismatch messages on the key-shaped APIs change to
The provided key element does not match the schema.ItemCollectionMetricsis present as{}on TransactWriteItems and BatchWriteItem under SIZE with no LSI. TheConsumedCapacityarray of both transaction APIs is in table creation order. ExtendDB refuses at request time the ScanFilter, QueryFilter and KeyConditions conditions that the service refuses, with the messages of the service. PartiQL statements get the same refusals (PartiQL section above).By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.