File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ test('list', async () => {
5
5
expect ( res . data ?. find ( ( { name } ) => name === 'user_status' ) ) . toMatchInlineSnapshot (
6
6
{ id : expect . any ( Number ) } ,
7
7
`
8
- {
8
+ Object {
9
+ "attributes": Array [],
9
10
"comment": null,
10
11
"enums": [
11
12
"ACTIVE",
@@ -54,3 +55,34 @@ test('list types with excluded schemas and include System Schemas', async () =>
54
55
expect ( type . schema ) . not . toBe ( 'public' )
55
56
} )
56
57
} )
58
+
59
+ test ( 'composite type attributes' , async ( ) => {
60
+ await pgMeta . query ( `create type test_composite as (id int8, data text);` )
61
+
62
+ const res = await pgMeta . types . list ( )
63
+ expect ( res . data ?. find ( ( { name } ) => name === 'test_composite' ) ) . toMatchInlineSnapshot (
64
+ { id : expect . any ( Number ) } ,
65
+ `
66
+ Object {
67
+ "attributes": Array [
68
+ Object {
69
+ "name": "id",
70
+ "type_id": 20,
71
+ },
72
+ Object {
73
+ "name": "data",
74
+ "type_id": 25,
75
+ },
76
+ ],
77
+ "comment": null,
78
+ "enums": Array [],
79
+ "format": "test_composite",
80
+ "id": Any<Number>,
81
+ "name": "test_composite",
82
+ "schema": "public",
83
+ }
84
+ `
85
+ )
86
+
87
+ await pgMeta . query ( `drop type test_composite;` )
88
+ } )
You can’t perform that action at this time.
0 commit comments