@@ -270,103 +270,54 @@ test('abort signal', async () => {
270270
271271test ( 'explain with json/text format' , async ( ) => {
272272 const res1 = await postgrest . from ( 'users' ) . select ( ) . explain ( { format : 'json' } )
273- expect ( res1 ) . toMatchInlineSnapshot ( `
273+ expect ( res1 ) . toMatchInlineSnapshot (
274+ {
275+ data : [
276+ {
277+ Plan : expect . any ( Object ) ,
278+ } ,
279+ ] ,
280+ } ,
281+ `
274282 Object {
275283 "count": null,
276284 "data": Array [
277285 Object {
278- "Plan": Object {
279- "Async Capable": false,
280- "Node Type": "Aggregate",
281- "Parallel Aware": false,
282- "Partial Mode": "Simple",
283- "Plan Rows": 1,
284- "Plan Width": 112,
285- "Plans": Array [
286- Object {
287- "Alias": "users",
288- "Async Capable": false,
289- "Node Type": "Seq Scan",
290- "Parallel Aware": false,
291- "Parent Relationship": "Outer",
292- "Plan Rows": 510,
293- "Plan Width": 132,
294- "Relation Name": "users",
295- "Startup Cost": 0,
296- "Total Cost": 15.1,
297- },
298- ],
299- "Startup Cost": 17.65,
300- "Strategy": "Plain",
301- "Total Cost": 17.67,
302- },
286+ "Plan": Any<Object>,
303287 },
304288 ],
305289 "error": null,
306290 "status": 200,
307291 "statusText": "OK",
308292 }
309- ` )
293+ `
294+ )
310295
311296 const res2 = await postgrest . from ( 'users' ) . select ( ) . explain ( )
312- expect ( res2 . data ) . toMatch (
313- `Aggregate (cost=17.65..17.67 rows=1 width=112)
314- -> Seq Scan on users (cost=0.00..15.10 rows=510 width=132)
315- `
316- )
297+ expect ( res2 . data ) . toMatch ( / A g g r e g a t e \( c o s t = .* / )
317298} )
318299
319300test ( 'explain with options' , async ( ) => {
320301 const res = await postgrest
321302 . from ( 'users' )
322303 . select ( )
323304 . explain ( { verbose : true , settings : true , format : 'json' } )
324- expect ( res ) . toMatchInlineSnapshot ( `
305+ expect ( res ) . toMatchInlineSnapshot (
306+ {
307+ data : [
308+ {
309+ Plan : expect . any ( Object ) ,
310+ 'Query Identifier' : expect . any ( Number ) ,
311+ } ,
312+ ] ,
313+ } ,
314+ `
325315 Object {
326316 "count": null,
327317 "data": Array [
328318 Object {
329- "Plan": Object {
330- "Async Capable": false,
331- "Node Type": "Aggregate",
332- "Output": Array [
333- "NULL::bigint",
334- "count(ROW(users.username, users.data, users.age_range, users.status, users.catchphrase))",
335- "COALESCE(json_agg(ROW(users.username, users.data, users.age_range, users.status, users.catchphrase)), '[]'::json)",
336- "NULLIF(current_setting('response.headers'::text, true), ''::text)",
337- "NULLIF(current_setting('response.status'::text, true), ''::text)",
338- ],
339- "Parallel Aware": false,
340- "Partial Mode": "Simple",
341- "Plan Rows": 1,
342- "Plan Width": 112,
343- "Plans": Array [
344- Object {
345- "Alias": "users",
346- "Async Capable": false,
347- "Node Type": "Seq Scan",
348- "Output": Array [
349- "users.username",
350- "users.data",
351- "users.age_range",
352- "users.status",
353- "users.catchphrase",
354- ],
355- "Parallel Aware": false,
356- "Parent Relationship": "Outer",
357- "Plan Rows": 510,
358- "Plan Width": 132,
359- "Relation Name": "users",
360- "Schema": "public",
361- "Startup Cost": 0,
362- "Total Cost": 15.1,
363- },
364- ],
365- "Startup Cost": 17.65,
366- "Strategy": "Plain",
367- "Total Cost": 17.67,
368- },
369- "Query Identifier": 3302819211508333000,
319+ "Plan": Any<Object>,
320+ "Query Identifier": Any<Number>,
370321 "Settings": Object {
371322 "effective_cache_size": "128MB",
372323 "search_path": "\\"public\\", \\"extensions\\"",
@@ -377,7 +328,8 @@ test('explain with options', async () => {
377328 "status": 200,
378329 "statusText": "OK",
379330 }
380- ` )
331+ `
332+ )
381333} )
382334
383335test ( 'rollback insert/upsert' , async ( ) => {
0 commit comments