@@ -4,21 +4,20 @@ import { pgMeta } from './utils'
44test ( 'list' , async ( ) => {
55 const res = await pgMeta . functions . list ( )
66 expect ( res . data ?. find ( ( { name } ) => name === 'add' ) ) . toMatchInlineSnapshot (
7- { id : expect . any ( Number ) } , `
7+ { id : expect . any ( Number ) } ,
8+ `
89 {
910 "args": [
1011 {
1112 "has_default": false,
1213 "mode": "in",
1314 "name": "",
14- "table_name": null,
1515 "type_id": 23,
1616 },
1717 {
1818 "has_default": false,
1919 "mode": "in",
2020 "name": "",
21- "table_name": null,
2221 "type_id": 23,
2322 },
2423 ],
@@ -44,7 +43,8 @@ test('list', async () => {
4443 "schema": "public",
4544 "security_definer": false,
4645 }
47- ` )
46+ `
47+ )
4848} )
4949
5050test ( 'list set-returning function with single object limit' , async ( ) => {
@@ -58,7 +58,6 @@ test('list set-returning function with single object limit', async () => {
5858 "has_default": false,
5959 "mode": "in",
6060 "name": "user_row",
61- "table_name": "users",
6261 "type_id": 16395,
6362 },
6463 ],
@@ -102,7 +101,6 @@ test('list set-returning function with multiples definitions', async () => {
102101 "has_default": false,
103102 "mode": "in",
104103 "name": "user_row",
105- "table_name": "users",
106104 "type_id": 16395,
107105 },
108106 ],
@@ -138,7 +136,6 @@ test('list set-returning function with multiples definitions', async () => {
138136 "has_default": false,
139137 "mode": "in",
140138 "name": "todo_row",
141- "table_name": "todos",
142139 "type_id": 16404,
143140 },
144141 ],
@@ -224,22 +221,21 @@ test('retrieve, create, update, delete', async () => {
224221 config_params : { search_path : 'hooks, auth' , role : 'postgres' } ,
225222 } )
226223 expect ( res ) . toMatchInlineSnapshot (
227- { data : { id : expect . any ( Number ) } } , `
224+ { data : { id : expect . any ( Number ) } } ,
225+ `
228226 {
229227 "data": {
230228 "args": [
231229 {
232230 "has_default": false,
233231 "mode": "in",
234232 "name": "a",
235- "table_name": null,
236233 "type_id": 21,
237234 },
238235 {
239236 "has_default": false,
240237 "mode": "in",
241238 "name": "b",
242- "table_name": null,
243239 "type_id": 21,
244240 },
245241 ],
@@ -272,25 +268,25 @@ test('retrieve, create, update, delete', async () => {
272268 },
273269 "error": null,
274270 }
275- ` )
271+ `
272+ )
276273 res = await pgMeta . functions . retrieve ( { id : res . data ! . id } )
277274 expect ( res ) . toMatchInlineSnapshot (
278- { data : { id : expect . any ( Number ) } } , `
275+ { data : { id : expect . any ( Number ) } } ,
276+ `
279277 {
280278 "data": {
281279 "args": [
282280 {
283281 "has_default": false,
284282 "mode": "in",
285283 "name": "a",
286- "table_name": null,
287284 "type_id": 21,
288285 },
289286 {
290287 "has_default": false,
291288 "mode": "in",
292289 "name": "b",
293- "table_name": null,
294290 "type_id": 21,
295291 },
296292 ],
@@ -323,29 +319,29 @@ test('retrieve, create, update, delete', async () => {
323319 },
324320 "error": null,
325321 }
326- ` )
322+ `
323+ )
327324 res = await pgMeta . functions . update ( res . data ! . id , {
328325 name : 'test_func_renamed' ,
329326 schema : 'test_schema' ,
330327 definition : 'select b - a' ,
331328 } )
332329 expect ( res ) . toMatchInlineSnapshot (
333- { data : { id : expect . any ( Number ) } } , `
330+ { data : { id : expect . any ( Number ) } } ,
331+ `
334332 {
335333 "data": {
336334 "args": [
337335 {
338336 "has_default": false,
339337 "mode": "in",
340338 "name": "a",
341- "table_name": null,
342339 "type_id": 21,
343340 },
344341 {
345342 "has_default": false,
346343 "mode": "in",
347344 "name": "b",
348- "table_name": null,
349345 "type_id": 21,
350346 },
351347 ],
@@ -378,25 +374,25 @@ test('retrieve, create, update, delete', async () => {
378374 },
379375 "error": null,
380376 }
381- ` )
377+ `
378+ )
382379 res = await pgMeta . functions . remove ( res . data ! . id )
383380 expect ( res ) . toMatchInlineSnapshot (
384- { data : { id : expect . any ( Number ) } } , `
381+ { data : { id : expect . any ( Number ) } } ,
382+ `
385383 {
386384 "data": {
387385 "args": [
388386 {
389387 "has_default": false,
390388 "mode": "in",
391389 "name": "a",
392- "table_name": null,
393390 "type_id": 21,
394391 },
395392 {
396393 "has_default": false,
397394 "mode": "in",
398395 "name": "b",
399- "table_name": null,
400396 "type_id": 21,
401397 },
402398 ],
@@ -429,7 +425,8 @@ test('retrieve, create, update, delete', async () => {
429425 },
430426 "error": null,
431427 }
432- ` )
428+ `
429+ )
433430 res = await pgMeta . functions . retrieve ( { id : res . data ! . id } )
434431 expect ( res ) . toMatchObject ( {
435432 data : null ,
@@ -452,7 +449,8 @@ test('retrieve set-returning function', async () => {
452449 id : expect . any ( Number ) ,
453450 return_type_id : expect . any ( Number ) ,
454451 return_type_relation_id : expect . any ( Number ) ,
455- } , `
452+ } ,
453+ `
456454 {
457455 "args": [],
458456 "argument_types": "",
@@ -481,7 +479,8 @@ test('retrieve set-returning function', async () => {
481479 "schema": "public",
482480 "security_definer": false,
483481 }
484- ` )
482+ `
483+ )
485484} )
486485
487486test ( 'retrieve function by args filter - polymorphic function with text argument' , async ( ) => {
0 commit comments