@@ -4,21 +4,20 @@ import { pgMeta } from './utils'
4
4
test ( 'list' , async ( ) => {
5
5
const res = await pgMeta . functions . list ( )
6
6
expect ( res . data ?. find ( ( { name } ) => name === 'add' ) ) . toMatchInlineSnapshot (
7
- { id : expect . any ( Number ) } , `
7
+ { id : expect . any ( Number ) } ,
8
+ `
8
9
{
9
10
"args": [
10
11
{
11
12
"has_default": false,
12
13
"mode": "in",
13
14
"name": "",
14
- "table_name": null,
15
15
"type_id": 23,
16
16
},
17
17
{
18
18
"has_default": false,
19
19
"mode": "in",
20
20
"name": "",
21
- "table_name": null,
22
21
"type_id": 23,
23
22
},
24
23
],
@@ -44,7 +43,8 @@ test('list', async () => {
44
43
"schema": "public",
45
44
"security_definer": false,
46
45
}
47
- ` )
46
+ `
47
+ )
48
48
} )
49
49
50
50
test ( 'list set-returning function with single object limit' , async ( ) => {
@@ -58,7 +58,6 @@ test('list set-returning function with single object limit', async () => {
58
58
"has_default": false,
59
59
"mode": "in",
60
60
"name": "user_row",
61
- "table_name": "users",
62
61
"type_id": 16395,
63
62
},
64
63
],
@@ -102,7 +101,6 @@ test('list set-returning function with multiples definitions', async () => {
102
101
"has_default": false,
103
102
"mode": "in",
104
103
"name": "user_row",
105
- "table_name": "users",
106
104
"type_id": 16395,
107
105
},
108
106
],
@@ -138,7 +136,6 @@ test('list set-returning function with multiples definitions', async () => {
138
136
"has_default": false,
139
137
"mode": "in",
140
138
"name": "todo_row",
141
- "table_name": "todos",
142
139
"type_id": 16404,
143
140
},
144
141
],
@@ -224,22 +221,21 @@ test('retrieve, create, update, delete', async () => {
224
221
config_params : { search_path : 'hooks, auth' , role : 'postgres' } ,
225
222
} )
226
223
expect ( res ) . toMatchInlineSnapshot (
227
- { data : { id : expect . any ( Number ) } } , `
224
+ { data : { id : expect . any ( Number ) } } ,
225
+ `
228
226
{
229
227
"data": {
230
228
"args": [
231
229
{
232
230
"has_default": false,
233
231
"mode": "in",
234
232
"name": "a",
235
- "table_name": null,
236
233
"type_id": 21,
237
234
},
238
235
{
239
236
"has_default": false,
240
237
"mode": "in",
241
238
"name": "b",
242
- "table_name": null,
243
239
"type_id": 21,
244
240
},
245
241
],
@@ -272,25 +268,25 @@ test('retrieve, create, update, delete', async () => {
272
268
},
273
269
"error": null,
274
270
}
275
- ` )
271
+ `
272
+ )
276
273
res = await pgMeta . functions . retrieve ( { id : res . data ! . id } )
277
274
expect ( res ) . toMatchInlineSnapshot (
278
- { data : { id : expect . any ( Number ) } } , `
275
+ { data : { id : expect . any ( Number ) } } ,
276
+ `
279
277
{
280
278
"data": {
281
279
"args": [
282
280
{
283
281
"has_default": false,
284
282
"mode": "in",
285
283
"name": "a",
286
- "table_name": null,
287
284
"type_id": 21,
288
285
},
289
286
{
290
287
"has_default": false,
291
288
"mode": "in",
292
289
"name": "b",
293
- "table_name": null,
294
290
"type_id": 21,
295
291
},
296
292
],
@@ -323,29 +319,29 @@ test('retrieve, create, update, delete', async () => {
323
319
},
324
320
"error": null,
325
321
}
326
- ` )
322
+ `
323
+ )
327
324
res = await pgMeta . functions . update ( res . data ! . id , {
328
325
name : 'test_func_renamed' ,
329
326
schema : 'test_schema' ,
330
327
definition : 'select b - a' ,
331
328
} )
332
329
expect ( res ) . toMatchInlineSnapshot (
333
- { data : { id : expect . any ( Number ) } } , `
330
+ { data : { id : expect . any ( Number ) } } ,
331
+ `
334
332
{
335
333
"data": {
336
334
"args": [
337
335
{
338
336
"has_default": false,
339
337
"mode": "in",
340
338
"name": "a",
341
- "table_name": null,
342
339
"type_id": 21,
343
340
},
344
341
{
345
342
"has_default": false,
346
343
"mode": "in",
347
344
"name": "b",
348
- "table_name": null,
349
345
"type_id": 21,
350
346
},
351
347
],
@@ -378,25 +374,25 @@ test('retrieve, create, update, delete', async () => {
378
374
},
379
375
"error": null,
380
376
}
381
- ` )
377
+ `
378
+ )
382
379
res = await pgMeta . functions . remove ( res . data ! . id )
383
380
expect ( res ) . toMatchInlineSnapshot (
384
- { data : { id : expect . any ( Number ) } } , `
381
+ { data : { id : expect . any ( Number ) } } ,
382
+ `
385
383
{
386
384
"data": {
387
385
"args": [
388
386
{
389
387
"has_default": false,
390
388
"mode": "in",
391
389
"name": "a",
392
- "table_name": null,
393
390
"type_id": 21,
394
391
},
395
392
{
396
393
"has_default": false,
397
394
"mode": "in",
398
395
"name": "b",
399
- "table_name": null,
400
396
"type_id": 21,
401
397
},
402
398
],
@@ -429,7 +425,8 @@ test('retrieve, create, update, delete', async () => {
429
425
},
430
426
"error": null,
431
427
}
432
- ` )
428
+ `
429
+ )
433
430
res = await pgMeta . functions . retrieve ( { id : res . data ! . id } )
434
431
expect ( res ) . toMatchObject ( {
435
432
data : null ,
@@ -452,7 +449,8 @@ test('retrieve set-returning function', async () => {
452
449
id : expect . any ( Number ) ,
453
450
return_type_id : expect . any ( Number ) ,
454
451
return_type_relation_id : expect . any ( Number ) ,
455
- } , `
452
+ } ,
453
+ `
456
454
{
457
455
"args": [],
458
456
"argument_types": "",
@@ -481,7 +479,8 @@ test('retrieve set-returning function', async () => {
481
479
"schema": "public",
482
480
"security_definer": false,
483
481
}
484
- ` )
482
+ `
483
+ )
485
484
} )
486
485
487
486
test ( 'retrieve function by args filter - polymorphic function with text argument' , async ( ) => {
0 commit comments