Add node_to_text tests for MultiColumnSetComponent

This commit is contained in:
tibotix 2023-11-17 18:00:58 +01:00
parent e08bb30585
commit 26fd4bf11e
No known key found for this signature in database
GPG Key ID: 96DF02FF50AC54C7
1 changed files with 13 additions and 0 deletions

View File

@ -407,6 +407,11 @@ CREATE UNIQUE INDEX my_idx ON t1 (c1, c2, c3) WHERE c1 < c3;
'ON CONFLICT DO UPDATE SET a = b, c = d WHERE d < a;');
});
test('upsert - update with column-name-list', () {
testFormat('INSERT INTO foo VALUES (1, 2, 3) '
'ON CONFLICT DO UPDATE SET (a, c) = (b, d) WHERE d < a;');
});
test('upsert - multiple clauses', () {
testFormat('INSERT INTO foo VALUES (1, 2, 3) '
'ON CONFLICT DO NOTHING '
@ -419,6 +424,14 @@ CREATE UNIQUE INDEX my_idx ON t1 (c1, c2, c3) WHERE c1 < c3;
testFormat('UPDATE foo SET bar = baz WHERE 1;');
});
test('with column-name-list', () {
testFormat('UPDATE foo SET (bar, baz) = (baz, bar) WHERE 1;');
});
test('with column-name-list and subquery', () {
testFormat('UPDATE foo SET (bar, baz) = (SELECT 1,2) WHERE 1;');
});
test('with returning', () {
testFormat('UPDATE foo SET bar = baz RETURNING *');
});