@@ -478,13 +478,16 @@ INSERT INTO test_data(id, time, timestamp, timestamptz) VALUES (1, '17:42:01.12'
478478 await db . query ( `CREATE DOMAIN rating_value AS FLOAT CHECK (VALUE BETWEEN 0 AND 5);` ) ;
479479 await db . query ( `CREATE TYPE composite AS (foo rating_value[], bar TEXT);` ) ;
480480 await db . query ( `CREATE TYPE nested_composite AS (a BOOLEAN, b composite);` ) ;
481+ await db . query ( `CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy')` ) ;
481482
482483 await db . query ( `CREATE TABLE test_custom(
483484 id serial primary key,
484485 rating rating_value,
485486 composite composite,
486487 nested_composite nested_composite,
487- boxes box[]
488+ boxes box[],
489+ mood mood,
490+ ranges int4multirange[]
488491 );` ) ;
489492
490493 const slotName = 'test_slot' ;
@@ -501,12 +504,14 @@ INSERT INTO test_data(id, time, timestamp, timestamptz) VALUES (1, '17:42:01.12'
501504
502505 await db . query ( `
503506 INSERT INTO test_custom
504- (rating, composite, nested_composite, boxes)
507+ (rating, composite, nested_composite, boxes, mood, ranges )
505508 VALUES (
506509 1,
507510 (ARRAY[2,3], 'bar'),
508511 (TRUE, (ARRAY[2,3], 'bar')),
509- ARRAY[box(point '(1,2)', point '(3,4)'), box(point '(5, 6)', point '(7,8)')]
512+ ARRAY[box(point '(1,2)', point '(3,4)'), box(point '(5, 6)', point '(7,8)')],
513+ 'happy',
514+ ARRAY[int4multirange(int4range(2, 4), int4range(5, 7, '(]'))]::int4multirange[]
510515 );
511516 ` ) ;
512517
@@ -527,15 +532,24 @@ INSERT INTO test_data(id, time, timestamp, timestamptz) VALUES (1, '17:42:01.12'
527532 rating : '1' ,
528533 composite : '("{2,3}",bar)' ,
529534 nested_composite : '(t,"(""{2,3}"",bar)")' ,
530- boxes : '["(3","4)","(1","2);(7","8)","(5","6)"]'
535+ boxes : '["(3","4)","(1","2);(7","8)","(5","6)"]' ,
536+ mood : 'happy' ,
537+ ranges : '{"{[2,4),[6,8)}"}'
531538 } ) ;
532539
533540 const newFormat = applyRowContext ( transformed , new CompatibilityContext ( CompatibilityEdition . SYNC_STREAMS ) ) ;
534541 expect ( newFormat ) . toMatchObject ( {
535542 rating : 1 ,
536543 composite : '{"foo":[2.0,3.0],"bar":"bar"}' ,
537544 nested_composite : '{"a":1,"b":{"foo":[2.0,3.0],"bar":"bar"}}' ,
538- boxes : JSON . stringify ( [ '(3,4),(1,2)' , '(7,8),(5,6)' ] )
545+ boxes : JSON . stringify ( [ '(3,4),(1,2)' , '(7,8),(5,6)' ] ) ,
546+ mood : 'happy' ,
547+ ranges : JSON . stringify ( [
548+ [
549+ { lower : 2 , upper : 4 , lower_exclusive : 0 , upper_exclusive : 1 } ,
550+ { lower : 6 , upper : 8 , lower_exclusive : 0 , upper_exclusive : 1 }
551+ ]
552+ ] )
539553 } ) ;
540554 } finally {
541555 await db . end ( ) ;
0 commit comments