Repository navigation
Closed
Description
Priority: low. Statements and expressions the in-memory backend handles differently from DynamoDB (backend/memory/partiql.rs, expr/):
- PartiQL batches and transactions:
BatchExecuteStatementaccepts a mix of reads and writes ("The entire batch must consist of either read statements or write statements");ReturnValuesOnConditionCheckFailure=ALL_OLDis ignored in batches (BatchStatementError.Item) and inExecuteTransaction(CancellationReason.Item); a missing table inExecuteTransactiongivesTransactionCanceledExceptionwith reasonResourceNotFound(memoryTransactWriteItemsfails withResourceNotFoundException), and in a batch read "must specify the primary key". - PartiQL syntax: a negative literal after a keyword fails (
WHERE n BETWEEN -5 AND 5,n = 1 OR -3 = n);DELETE ... RETURNING ALL NEW *,INSERT INTO table.index, anUPDATEwithoutSET/REMOVE,exists(path),Limit=0and an 80-characterExecuteTransactiontoken are accepted;SET c = set_add(b, <<'t'>>)ignoresb, andset_add(n, 5)adds numbers. - PartiQL capacity:
SELECTalways reportsTOTAL(also whenINDEXESwas asked for), aDELETEof a missing item reports none, and batch reads and read transactions report nothing. - Expressions: the 300 operators/functions limit is not enforced ("The expression contains too many operators; operator count: 301"); redundant parentheses (
((a = :v))) are accepted ("The expression has redundant parentheses"); the 255-byte limit of placeholder names is not enforced; empty attribute names are accepted through placeholders and in items, and so are names of 64 KB or more;contains(a, a)andattribute_type(a, b)(a path as the type) are accepted; placeholders with invalid characters (#a-b) are reported as unused rather than invalid;_core._check_expressionsskipsvalidate_update. - Messages: the hash key size message lacks DynamoDB's missing space ("maximum size limit of2048 bytes"), an
UpdateItemover 400 KB usesPutItem's message ("Item size to update has exceeded the maximum allowed size"), and an empty binary index key says "empty string value".
Found in a review of the library for bugs (fctl session); the fixes that fit in its ten pull requests are #61 to #65, #67 to #70 and #72.
Activity
fctl-sh commentedon Oct 30, 2026
More gaps of this kind, found while fixing #75 (#104) by comparing the in-memory
ExecuteTransactionandBatchExecuteStatementwith dynoxide-rs, whose tests and notes say they were captured against DynamoDB (eu-west-2 and us-east-1). Each was checked on the memory backend:BatchExecuteStatementbefore running any statement, withValidationException: Provided list of item keys contains duplicates(tests/partiql.rs,test_batch_execute_rejects_duplicate_item_keys). The memory backend runs both statements (anINSERTand anUPDATEof one item both succeed).RETURNINGin a transaction: DynamoDB refuses it with a top-levelValidationException,Validation failed in TransactStatements[0]: RETURNING clause is not supported in ExecuteTransaction.(src/actions/execute_transaction.rs). The memory backend runs the statement and ignores the clause.ExecuteTransaction API does not support both read and write operations in the same request.(tests/execute_transaction.rs,test_mixed_select_and_insert); the memory backend saysTransaction must contain either all reads or all writes.UPDATEandDELETEstatements such as... WHERE pk = 'x' AND pk = 'y' AND sk = 1withMultiple conditions on same key pk. Only single item Update/Insert/Delete are supported(src/partiql/executor.rs,single_item_key). The memory backend uses the first value and fails withConditionalCheckFailedException.fix(memory): PartiQL transactions that name an item twice are refused (…
fix(memory): PartiQL and expressions follow DynamoDB's rules, and han…
fctl-sh commentedon Oct 31, 2026
Most of this issue, and the gaps of the comment above, are handled in #135, following what dynoxide-rs captured against DynamoDB: mixed and repeated-item PartiQL batches,
RETURNINGand mixed reads and writes inExecuteTransaction, a key given two values,ALL_OLDitems in batches and transactions, missing tables in batch reads, negative literals after keywords,DELETE ... RETURNING ALL NEW *, writes to an index,UPDATEwithoutSET/REMOVE,exists(),Limit=0, long transaction tokens,set_add/set_deletearguments, PartiQL capacity (INDEXES, deletes of missing items, batch reads, read transactions, and the transactional factor applying to the table only), the 300-operator limit, redundant parentheses, empty attribute names,contains(a, a),_check_expressionsvalidating update paths, and the three messages.Left, because no source I could check settles them (and the sandbox has no AWS credentials):
#name,:value): documented, but no source gives the error message.attribute_type(a, b)with a path as the type: dynoxide-rs accepts it in classic expressions (and evaluates it to false); DynamoDB's answer is not captured. In PartiQL it is refused.#a-b): probably a syntax error at-, by inference from the tokenizer; not captured.ExecuteTransactionon a missing table: the captured answer for writes is aTransactionCanceledExceptionwith reasonResourceNotFound; for reads it is only inferred, so the memory backend keeps its top-levelResourceNotFoundException.Each can be settled with one call against DynamoDB, for example
aws dynamodb querywith--expression-attribute-namesholding a 256-byte#placeholder, oraws dynamodb execute-transactionwith oneSELECTon a missing table.fix(memory): PartiQL and expressions follow DynamoDB's rules, and han…
docs(parity): keep DynamoDB's measured answers and the probes that as…
fix(expressions): the in-memory backend refuses placeholders, names a…
fix(errors): LocalStack's DuplicateItem code raises DuplicateItemErro…