fix(dynamodb): check the arguments of PartiQL set_add, set_delete and list_append (#7737)

* fix(dynamodb): check the arguments of PartiQL set_add, set_delete and list_append

* test(dynamodb): cover a list_append with a wrong operand count after the INSERT table name
This commit is contained in:
TATSUNO “Taz” Yasuhiro authored and GitHub committed 2026-11-07 10:02:50 -04:00
1 parent 46a8cbe51d
commit 5af751cec8
3 files changed
+273 -55

No files matched your search

@@ -762,7 +762,7 @@ public class DynamoDbPartiQLParser {
if (peek().type() != TType.VALUE) {
requireTermStart();
// DynamoDB reads what follows the table name as the items to insert.
parseOperand();
parseCallArgument(true);
if (peek().type() == TType.SEMICOLON) {
advance();
}
@@ -1222,15 +1222,29 @@ public class DynamoDbPartiQLParser {
private static final Map<String, Integer> CONDITION_FUNCTION_OPERANDS = Map.of("attribute_exists", 1,
"attribute_not_exists", 1, "size", 1, "attribute_type", 2, "begins_with", 2, "contains", 2);
private static final int LIST_APPEND_OPERANDS = 2;
private static final Set<String> TYPES_WITHOUT_SIZE = Set.of("N", "BOOL", "NULL");
private static final Set<String> BEGINS_WITH_TYPES = Set.of("S", "B");
private static final Set<String> LIST_TYPE = Set.of("L");
private static final Set<String> NUMBER_TYPE = Set.of("N");
// Stands in for a term of a statement DynamoDB refuses, so the statement can be read to its end.
private static final Path PATH_STAND_IN = new Path(List.of(new Seg.Name("call")));
// A path has no type. A call has a type, and no value Floci can read.
private record Argument(Token start, Path path, PVal value, String type) {}
// A path has no type. A call has a type, and only list_append has an operand Floci can read.
private record Argument(Token start, Operand operand, String type) {
Path path() {
return operand instanceof Operand.Attribute attribute ? attribute.path() : null;
}
PVal value() {
return operand instanceof Operand.Value value ? value.val() : null;
}
}
private Cond parseCallCondition() {
Token name = advance();
@@ -1304,14 +1318,14 @@ public class DynamoDbPartiQLParser {
+ " expression; function: " + function);
} else if (!isFunctionOf(update, function)) {
defer("Unrecognized function: " + function + " at " + position(name));
} else if (!update) {
} else {
checkOperands(function, arguments);
}
return arguments;
}
private void checkOperands(String function, List<Argument> operands) {
if (operands.size() != CONDITION_FUNCTION_OPERANDS.get(function)) {
if (operands.size() != CONDITION_FUNCTION_OPERANDS.getOrDefault(function, LIST_APPEND_OPERANDS)) {
deferExpression("Incorrect number of operands for operator or function; operator or function: "
+ function + ", number of operands: " + operands.size());
return;
@@ -1330,6 +1344,7 @@ public class DynamoDbPartiQLParser {
deferExpression(incorrectOperandType(function, first.type()));
}
}
case "list_append" -> operands.forEach(operand -> requireOperandType(function, LIST_TYPE, operand));
default -> {
if (first.path() != null && first.path().equals(last.path())) {
deferExpression("The first operand must be distinct from the remaining operands for this "
@@ -1337,7 +1352,7 @@ public class DynamoDbPartiQLParser {
+ first.path().display());
}
if ("begins_with".equals(function)) {
operands.forEach(this::requireBeginsWithType);
operands.forEach(operand -> requireOperandType(function, BEGINS_WITH_TYPES, operand));
} else if ("attribute_type".equals(function)) {
requireAttributeTypeName(last);
}
@@ -1345,9 +1360,9 @@ public class DynamoDbPartiQLParser {
}
}
private void requireBeginsWithType(Argument operand) {
if (operand.type() != null && !BEGINS_WITH_TYPES.contains(operand.type())) {
deferExpression(incorrectOperandType("begins_with", operand.type()));
private void requireOperandType(String function, Set<String> types, Argument operand) {
if (operand.type() != null && !types.contains(operand.type())) {
deferExpression(incorrectOperandType(function, operand.type()));
}
}
@@ -1402,14 +1417,18 @@ public class DynamoDbPartiQLParser {
private Argument parseCallArgument(boolean update) {
Token start = peek();
if (peekCall()) {
parseCall(advance(), update);
return new Argument(start, null, null, "size".equalsIgnoreCase(start.value()) ? "N" : "BOOL");
List<Argument> arguments = parseCall(advance(), update);
return switch (start.value().toLowerCase(Locale.ROOT)) {
case "size" -> new Argument(start, null, "N");
case "list_append" -> new Argument(start, listAppend(arguments), "L");
default -> new Argument(start, null, "BOOL");
};
}
if (start.type() == TType.IDENT) {
return new Argument(start, parsePath(), null, null);
return new Argument(start, new Operand.Attribute(parsePath()), null);
}
PVal value = parseValue();
return new Argument(start, null, value, typeCode(value));
return new Argument(start, new Operand.Value(value), typeCode(value));
}
private static final Map<String, PartiQLType> TYPE_NAMES = Map.ofEntries(
@@ -1593,39 +1612,50 @@ public class DynamoDbPartiQLParser {
if (peekFunction("set_add") || peekFunction("set_delete")) {
return parseSetMutation(path);
}
Operand left = parseOperand();
if (peek().type() == TType.PLUS || peek().type() == TType.MINUS) {
String op = advance().value();
requireRightHandSide();
Operand right = parseOperand();
requireNumberLiteral(op, left);
requireNumberLiteral(op, right);
return new Assign(path, left, op, right);
}
return new Assign(path, left, null, null);
Argument left = parseCallArgument(true);
return peekArithmetic() ? parseArithmetic(path, left) : new Assign(path, left.operand(), null, null);
}
private void requireNumberLiteral(String op, Operand operand) {
if (operand instanceof Operand.Value value && !(value.val() instanceof PVal.Num)) {
deferExpression(incorrectOperandType(op, typeCode(value.val())));
}
private boolean peekArithmetic() {
return peek().type() == TType.PLUS || peek().type() == TType.MINUS;
}
private SetClause parseArithmetic(Path path, Argument left) {
String op = advance().value();
requireRightHandSide();
Argument right = parseCallArgument(true);
requireOperandType(op, NUMBER_TYPE, left);
requireOperandType(op, NUMBER_TYPE, right);
return new Assign(path, left.operand(), op, right.operand());
}
private SetClause parseSetMutation(Path target) {
Token function = advance();
String name = function.value().toUpperCase(Locale.ROOT);
consume(TType.LPAREN);
Token firstArgument = peek();
if (!parsePath().equals(target)) {
String errorBeforeCall = deferredError;
List<Argument> arguments = parseCallArguments(function, true);
String shapeError = callShapeError(function, addPathSteps(new ArrayList<>()));
if (shapeError == null && peekArithmetic()) {
defer("Unrecognized function: " + name.toLowerCase(Locale.ROOT) + " at " + position(function));
return parseArithmetic(target, new Argument(function, null, null));
}
if (shapeError == null && arguments.size() != 2) {
shapeError = name + " must have exactly two arguments at " + position(function);
}
if (shapeError != null) {
deferredError = errorBeforeCall;
defer(shapeError);
return new SetAdd(target, null);
}
Argument first = arguments.getFirst();
Argument second = arguments.getLast();
if (!target.equals(first.path())) {
defer("The first argument to " + name + " must equal the assignment value at " + position(function));
} else if (second.type() == null || !SET_TYPES.contains(second.type())) {
defer("The second argument to " + name + " must be a value with type SET at " + position(first.start()));
}
consume(TType.COMMA);
PVal bag = parseValue();
consume(TType.RPAREN);
if (!SET_TYPES.contains(typeCode(bag))) {
defer("The second argument to " + name + " must be a value with type SET at " + position(firstArgument));
}
return "set_add".equalsIgnoreCase(function.value()) ? new SetAdd(target, bag) : new SetDelete(target, bag);
return "set_add".equalsIgnoreCase(function.value())
? new SetAdd(target, second.value()) : new SetDelete(target, second.value());
}
private String position(Token token) {
@@ -1639,24 +1669,9 @@ public class DynamoDbPartiQLParser {
return line + ":" + (start - lineStart + 1) + ":" + length;
}
private Operand parseOperand() {
if (peekFunction("list_append")) {
advance();
consume(TType.LPAREN);
Operand first = parseOperand();
consume(TType.COMMA);
Operand second = parseOperand();
consume(TType.RPAREN);
return new Operand.ListAppend(first, second);
}
if (peekCall()) {
parseCall(advance(), true);
return new Operand.Value(new PVal.Null());
}
if (peek().type() == TType.IDENT) {
return new Operand.Attribute(parsePath());
}
return new Operand.Value(parseValue());
private static Operand listAppend(List<Argument> arguments) {
return arguments.size() == LIST_APPEND_OPERANDS
? new Operand.ListAppend(arguments.getFirst().operand(), arguments.getLast().operand()) : null;
}
private Path parseSimplePath() {
@@ -16,6 +16,7 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.nullValue;
@@ -780,6 +781,38 @@ class DynamoDbPartiQLIntegrationTest {
+ "operator or function; operator: contains, first operand: [a]"));
}
@Test
@Order(37)
void anUpdateFunctionChecksItsArguments() {
putItem("update-function", "\"tags\":{\"SS\":[\"a\"]},\"items\":{\"L\":[{\"S\":\"a\"}]}");
String update = "UPDATE \"" + TABLE + "\" SET ";
String key = " WHERE pk = 'update-function'";
int function = update.length() + "tags = ".length() + 1;
statement(update + "tags = set_add(tags)" + key)
.statusCode(400)
.body("message", equalTo("SET_ADD must have exactly two arguments at 1:" + function + ":7"));
statement(update + "tags = set_add(<<'a'>>, <<'b'>>)" + key)
.statusCode(400)
.body("message", equalTo("The first argument to SET_ADD must equal the assignment value at 1:"
+ function + ":7"));
statement(update + "items = list_append(items)" + key)
.statusCode(400)
.body("message", equalTo("Incorrect number of operands for operator or function; "
+ "operator or function: list_append, number of operands: 1"));
statement(update + "items = list_append(items, 1)" + key)
.statusCode(400)
.body("message", equalTo("Incorrect operand type for operator or function; "
+ "operator or function: list_append, operand type: N"));
statement(update + "tags = set_add(tags, <<'b'>>), items = list_append(items, ['b'])" + key)
.statusCode(200);
statement("SELECT * FROM \"" + TABLE + "\"" + key)
.statusCode(200)
.body("Items[0].tags.SS", contains("a", "b"))
.body("Items[0].items.L.S", contains("a", "b"));
}
private static void putItem(String pk, String attributes) {
request("DynamoDB_20120810.PutItem", """
{"TableName":"%s","Item":{"pk":{"S":"%s"},%s}}
@@ -697,6 +697,175 @@ class DynamoDbPartiQLParserTest {
assertEquals(message, e.getMessage());
}
@ParameterizedTest
@CsvSource(delimiter = '|', quoteCharacter = '`', textBlock = """
UPDATE "t" SET a = set_add() WHERE pk = 1 | SET_ADD must have exactly two arguments at 1:20:7
UPDATE "t" SET a = set_add(a) WHERE pk = 1 | SET_ADD must have exactly two arguments at 1:20:7
UPDATE "t" SET a = set_delete(a, <<1>>, <<2>>) WHERE pk = 1 | SET_DELETE must have exactly two arguments at 1:20:10
UPDATE "t" SET a = "SET_ADD"(a) WHERE pk = 1 | SET_ADD must have exactly two arguments at 1:20:9
UPDATE "t" SET a = set_add(foo(1)) WHERE pk = 1 | SET_ADD must have exactly two arguments at 1:20:7
UPDATE "t" SET a = set_add(a, <<>>, 1) WHERE pk = 1 | SET_ADD must have exactly two arguments at 1:20:7
UPDATE "t" SET a = 'x' + 1, b = set_add(b) WHERE pk = 1 | SET_ADD must have exactly two arguments at 1:33:7
UPDATE "t" SET a = list_append(b), c = set_add(c) WHERE pk = 1 | SET_ADD must have exactly two arguments at 1:40:7
UPDATE "t" SET a = foo(1), b = set_add(b) WHERE pk = 1 | Unrecognized function: foo at 1:20:3
UPDATE "t" SET a = set_add(a), b = foo(1) WHERE pk = 1 | SET_ADD must have exactly two arguments at 1:20:7
UPDATE "t" SET a = set_add(b, 1), c = set_add(c) WHERE pk = 1 | The first argument to SET_ADD must equal the assignment value at 1:20:7
UPDATE "t" SET a = set_add(a) WHERE foo(1) | Unrecognized function: foo at 1:37:3
FROM "t" WHERE attribute_exists('x') SET a = set_add(a) | Operator or function requires a document path; operator or function: attribute_exists
UPDATE "t" SET a = set_add(a).b WHERE pk = 1 | Unexpected path component at 1:20:7
UPDATE "t" SET a = set_add(foo(1))[0] WHERE pk = 1 | Unexpected path component at 1:20:7
UPDATE "t" SET a = set_add(*) WHERE pk = 1 | Statement wasn't well formed, can't be processed: set_add(*) is not allowed
UPDATE "t" SET a = set_add(a WHERE pk = 1 | Statement wasn't well formed, can't be processed: Expected RIGHT_PAREN
""")
void refusesTheWrongNumberOfArgumentsToASetFunction(String statement, String message) {
AwsException e = assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(statement, List.of()));
assertEquals(message, e.getMessage());
}
@ParameterizedTest
@CsvSource(delimiter = '|', quoteCharacter = '`', textBlock = """
UPDATE "t" SET a = set_add(<<'a'>>, <<'b'>>) WHERE pk = 1 | The first argument to SET_ADD must equal the assignment value at 1:20:7
UPDATE "t" SET a = set_delete('a', 'b') WHERE pk = 1 | The first argument to SET_DELETE must equal the assignment value at 1:20:10
UPDATE "t" SET a = set_add(1, 2) WHERE pk = 1 | The first argument to SET_ADD must equal the assignment value at 1:20:7
UPDATE "t" SET a = set_add(list_append(a, [1]), 1) WHERE pk = 1 | The first argument to SET_ADD must equal the assignment value at 1:20:7
UPDATE "t" SET a = set_add(list_append(1, 2), 1) WHERE pk = 1 | The first argument to SET_ADD must equal the assignment value at 1:20:7
UPDATE "t" SET a = set_add(foo(1), <<'b'>>) WHERE pk = 1 | Unrecognized function: foo at 1:28:3
UPDATE "t" SET a = set_add(a, foo(1)) WHERE pk = 1 | Unrecognized function: foo at 1:31:3
UPDATE "t" SET a = set_add(b, foo(1)) WHERE pk = 1 | Unrecognized function: foo at 1:31:3
UPDATE "t" SET a = set_add(<<>>, <<'b'>>) WHERE pk = 1 | Empty bags are not supported
UPDATE "t" SET a = set_add(b, <<>>) WHERE pk = 1 | Empty bags are not supported
UPDATE "t" SET a = set_add(set_add(a, <<'a'>>), <<'b'>>) WHERE pk = 1 | Unrecognized function: set_add at 1:28:7
UPDATE "t" SET a = set_add(size(a), <<'b'>>) WHERE pk = 1 | The function is not allowed in an update expression; function: size
UPDATE "t" SET a = set_add(a, size(b)) WHERE pk = 1 | The function is not allowed in an update expression; function: size
UPDATE "t" SET a = set_add(a, list_append(b, [1])) WHERE pk = 1 | The second argument to SET_ADD must be a value with type SET at 1:28:1
UPDATE "t" SET a = set_add(a, list_append(1, 2)) WHERE pk = 1 | The second argument to SET_ADD must be a value with type SET at 1:28:1
UPDATE "t" SET a = set_add(a, b) WHERE pk = 1 | The second argument to SET_ADD must be a value with type SET at 1:28:1
UPDATE "t" SET a = set_add(a, b.c) WHERE pk = 1 | The second argument to SET_ADD must be a value with type SET at 1:28:1
""")
void refusesASetFunctionArgumentByItsKind(String statement, String message) {
AwsException e = assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(statement, List.of()));
assertEquals(message, e.getMessage());
}
@ParameterizedTest
@CsvSource(delimiter = '|', quoteCharacter = '`', textBlock = """
UPDATE "t" SET a = set_add(a) + 1 WHERE pk = 1 | Unrecognized function: set_add at 1:20:7
UPDATE "t" SET a = set_delete(a, <<'b'>>) - 1 WHERE pk = 1 | Unrecognized function: set_delete at 1:20:10
UPDATE "t" SET a = set_add(<<>>) + 1 WHERE pk = 1 | Empty bags are not supported
UPDATE "t" SET a = set_add(foo(1)) + 1 WHERE pk = 1 | Unrecognized function: foo at 1:28:3
UPDATE "t" SET a = set_add(a) + foo(1) WHERE pk = 1 | Unrecognized function: set_add at 1:20:7
UPDATE "t" SET a = set_add(b, 1) + 'x' WHERE pk = 1 | Unrecognized function: set_add at 1:20:7
UPDATE "t" SET a = 1 - set_add(a) WHERE pk = 1 | Unrecognized function: set_add at 1:24:7
""")
void readsASetFunctionBesideAnOperatorAsAnUnknownFunction(String statement, String message) {
AwsException e = assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(statement, List.of()));
assertEquals(message, e.getMessage());
}
@ParameterizedTest
@CsvSource(delimiter = '|', quoteCharacter = '`', textBlock = """
list_append() | 0
list_append(a) | 1
list_append([1]) | 1
LIST_APPEND(1) | 1
"list_append"('a') | 1
list_append(a [1]) | 1
list_append(a, [1], [2]) | 3
list_append(1, 2, 3, 4) | 4
""")
void refusesTheWrongNumberOfListAppendOperands(String call, String count) {
AwsException e = assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(
"UPDATE \"t\" SET a = " + call + " WHERE pk = 1", List.of()));
assertEquals("Incorrect number of operands for operator or function; operator or function: list_append, "
+ "number of operands: " + count, e.getMessage());
}
@ParameterizedTest
@CsvSource(delimiter = '|', quoteCharacter = '`', textBlock = """
list_append(1, 2) | N
list_append(a, 'x') | S
list_append('x', a) | S
list_append(true, a) | BOOL
list_append(a, null) | NULL
list_append(<<'x'>>, a) | SS
list_append(a, <<1>>) | NS
list_append({'x': 1}, a) | M
LIST_APPEND(1, 2) | N
list_append(list_append(1, 2)) | N
list_append(a, b, list_append(1, 2)) | N
list_append(list_append(a, [1]), 1) | N
""")
void refusesAListAppendOperandThatIsNotAList(String call, String type) {
AwsException e = assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(
"UPDATE \"t\" SET a = " + call + " WHERE pk = 1", List.of()));
assertEquals("Incorrect operand type for operator or function; operator or function: list_append, "
+ "operand type: " + type, e.getMessage());
}
@ParameterizedTest
@CsvSource(delimiter = '|', quoteCharacter = '`', textBlock = """
UPDATE "t" SET a = list_append(foo(1)) WHERE pk = 1 | Unrecognized function: foo at 1:32:3
UPDATE "t" SET a = list_append(a, foo(1), 1) WHERE pk = 1 | Unrecognized function: foo at 1:35:3
UPDATE "t" SET a = list_append(<<>>) WHERE pk = 1 | Empty bags are not supported
UPDATE "t" SET a = list_append(size(b)) WHERE pk = 1 | The function is not allowed in an update expression; function: size
UPDATE "t" SET a = list_append(l[99999999999]) WHERE pk = 1 | List index is not within the allowable range; index: [99999999999] at 1:34:11
UPDATE "t" SET a = list_append(b), c = foo(1) WHERE pk = 1 | Unrecognized function: foo at 1:40:3
UPDATE "t" SET a = list_append(1, 2), c = <<>> WHERE pk = 1 | Empty bags are not supported
UPDATE "t" SET a = list_append(b) WHERE foo(1) | Unrecognized function: foo at 1:41:3
FROM "t" WHERE a < true SET a = list_append(b) | Incorrect operand type for operator or function; operator or function: <, operand type: BOOL
UPDATE "t" SET a = 'x' + 1, b = list_append(c) WHERE pk = 1 | Incorrect operand type for operator or function; operator or function: +, operand type: S
UPDATE "t" SET a = list_append(b), c = 'x' + 1 WHERE pk = 1 | Incorrect number of operands for operator or function; operator or function: list_append, number of operands: 1
UPDATE "t" SET a = list_append(1, 2), b = list_append(c) WHERE pk = 1 | Incorrect operand type for operator or function; operator or function: list_append, operand type: N
UPDATE "t" SET a = list_append(list_append(b)) WHERE pk = 1 | Incorrect number of operands for operator or function; operator or function: list_append, number of operands: 1
UPDATE "t" SET a = list_append(1, list_append(b)) WHERE pk = 1 | Incorrect number of operands for operator or function; operator or function: list_append, number of operands: 1
UPDATE "t" SET a = list_append(b).c WHERE pk = 1 | Unexpected path component at 1:20:11
UPDATE "t" SET a = list_append(foo(1))[0] WHERE pk = 1 | Unexpected path component at 1:20:11
UPDATE "t" SET a = list_append(*) WHERE pk = 1 | Statement wasn't well formed, can't be processed: list_append(*) is not allowed
UPDATE "t" SET a = list_append(b WHERE pk = 1 | Statement wasn't well formed, can't be processed: Expected RIGHT_PAREN
""")
void reportsAListAppendOperandCheckInItsStage(String statement, String message) {
AwsException e = assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(statement, List.of()));
assertEquals(message, e.getMessage());
}
@ParameterizedTest
@CsvSource(delimiter = '|', quoteCharacter = '`', textBlock = """
UPDATE "t" SET a = list_append(b, [1]) + 1 WHERE pk = 1 | +, operand type: L
UPDATE "t" SET a = 1 - list_append(b, [1]) WHERE pk = 1 | -, operand type: L
UPDATE "t" SET a = list_append(b, [1]) + 'x' WHERE pk = 1 | +, operand type: L
UPDATE "t" SET a = 'x' + list_append(b, [1]) WHERE pk = 1 | +, operand type: S
UPDATE "t" SET a = list_append(1, 2) + 1 WHERE pk = 1 | list_append, operand type: N
""")
void refusesAListAppendBesideAnOperator(String statement, String operand) {
AwsException e = assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(statement, List.of()));
assertEquals("Incorrect operand type for operator or function; operator or function: " + operand,
e.getMessage());
}
@Test
void checksAParameterAsTheOperandOfAnUpdateFunction() {
List<JsonNode> string = List.of(json("{\"S\":\"x\"}"));
List<JsonNode> list = List.of(json("{\"L\":[]}"));
List<JsonNode> stringSet = List.of(json("{\"SS\":[\"x\"]}"));
String append = "UPDATE \"t\" SET a = list_append(a, ?) WHERE pk = 1";
String add = "UPDATE \"t\" SET a = set_add(a, ?) WHERE pk = 1";
assertDoesNotThrow(() -> DynamoDbPartiQLParser.parse(append, list));
assertDoesNotThrow(() -> DynamoDbPartiQLParser.parse(add, stringSet));
assertEquals("Incorrect operand type for operator or function; operator or function: list_append, "
+ "operand type: S",
assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(append, string)).getMessage());
assertEquals("The second argument to SET_ADD must be a value with type SET at 1:28:1",
assertThrows(AwsException.class, () -> DynamoDbPartiQLParser.parse(add, string)).getMessage());
}
@Test
void countsInOperandsWithTheOperandChecks() {
String tooMany = "The IN operator is provided with too many operands; number of operands: 101";
@@ -909,6 +1078,7 @@ class DynamoDbPartiQLParserTest {
DELETE FROM "t" WHERE pk = 1 RETURNING ALL NEW * x | LEFTOVER
INSERT INTO "t" a VALUE {'pk': 1} | LEFTOVER
INSERT INTO "t" {'pk': 1e126}; | MULTIPLE_ITEMS
INSERT INTO "t" list_append(a) | MULTIPLE_ITEMS
INSERT INTO "t" AS a VALUE {'pk': 1} | NWF Unexpected term
SELECT * FROM "t" WHERE at = 1 | NWF Unexpected term
UPDATE "t" SET as = 1 WHERE pk = 1 | NWF Expected identifier for simple path