{ "/api/sb/rest/v1 answers as PostgREST does > anon reads every profile": { "(hooks)#0": [ {"sql":"select relkind from pg_class where oid = to_regclass($1)","params":["\"profiles\""],"result":{"command":"SELECT","rowCount":1,"columns":[["relkind",18]],"rows":[["r"]]}}, {"sql":"\n select ic.relname as name, am.amname as method, (i.indpred is not null) as partial, a.attname::text as column,\n pg_get_indexdef(i.indexrelid, k.ord::int, true) as definition, oc.opcname::text as opclass\n from pg_index i\n join pg_class ic on ic.oid = i.indexrelid\n join pg_am am on am.oid = ic.relam\n cross join lateral unnest(i.indkey::int2[], i.indclass::oid[]) with ordinality k(attnum, opclass, ord)\n left join pg_attribute a on a.attrelid = i.indrelid and a.attnum = k.attnum and k.attnum > 0\n join pg_opclass oc on oc.oid = k.opclass\n where i.indrelid = to_regclass($1) and i.indisvalid and i.indisready and k.ord <= i.indnkeyatts\n order by ic.relname, k.ord\n ","params":["\"profiles\""],"result":{"command":"SELECT","rowCount":2,"columns":[["name",19],["method",19],["partial",16],["column",25],["definition",25],["opclass",25]],"rows":[ ["profiles_pkey","btree","f","id","id","uuid_ops"], ["profiles_username_key","btree","f","username","username","text_ops"] ]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"profiles\".* from \"profiles\" as \"profiles\" order by \"profiles\".\"username\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"username\":\"alice\",\"full_name\":\"Alice Adams\",\"website\":\"https://alice.example.com\"}, \n {\"id\":\"1a1a1a1a-0000-0000-0000-000000000002\",\"username\":\"bob\",\"full_name\":\"Bob Brown\",\"website\":null}, \n {\"id\":\"1a1a1a1a-0000-0000-0000-000000000003\",\"username\":\"carol\",\"full_name\":null,\"website\":null}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > anon reads no todo under RLS": { "(hooks)#0": [ {"sql":"select relkind from pg_class where oid = to_regclass($1)","params":["\"todos\""],"result":{"command":"SELECT","rowCount":1,"columns":[["relkind",18]],"rows":[["r"]]}}, {"sql":"\n select ic.relname as name, am.amname as method, (i.indpred is not null) as partial, a.attname::text as column,\n pg_get_indexdef(i.indexrelid, k.ord::int, true) as definition, oc.opcname::text as opclass\n from pg_index i\n join pg_class ic on ic.oid = i.indexrelid\n join pg_am am on am.oid = ic.relam\n cross join lateral unnest(i.indkey::int2[], i.indclass::oid[]) with ordinality k(attnum, opclass, ord)\n left join pg_attribute a on a.attrelid = i.indrelid and a.attnum = k.attnum and k.attnum > 0\n join pg_opclass oc on oc.oid = k.opclass\n where i.indrelid = to_regclass($1) and i.indisvalid and i.indisready and k.ord <= i.indnkeyatts\n order by ic.relname, k.ord\n ","params":["\"todos\""],"result":{"command":"SELECT","rowCount":13,"columns":[["name",19],["method",19],["partial",16],["column",25],["definition",25],["opclass",25]],"rows":[ ["todos_done_idx","btree","f","done","done","bool_ops"], ["todos_due_idx","btree","f","due","due","date_ops"], ["todos_during_idx","gist","f","during","during","range_ops"], ["todos_expr_idx","btree","f",null,"(meta ->> 'kind'::text)","text_ops"], ["todos_meta_idx","gin","f","meta","meta","jsonb_ops"], ["todos_pkey","btree","f","id","id","int8_ops"], ["todos_priority_idx","btree","f","priority","priority","int4_ops"], ["todos_search_idx","gin","f","search","search","tsvector_ops"], ["todos_tags_idx","gin","f","tags","tags","array_ops"], ["todos_title_idx","btree","f","title","title","text_ops"], ["todos_title_idx1","gin","f","title","title","gin_trgm_ops"], ["todos_user_id_id_idx","btree","f","user_id","user_id","uuid_ops"], ["todos_user_id_id_idx","btree","f","id","id","int8_ops"] ]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".* from \"todos\" as \"todos\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[]","0",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > alice reads her own todos only": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".* from \"todos\" as \"todos\" order by \"todos\".\"id\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Buy milk\",\"done\":false,\"priority\":1,\"tags\":[\"home\",\"shopping\"],\"meta\":{\"cost\": 3, \"kind\": \"errand\"},\"due\":\"2026-03-01\",\"during\":\"[\\\"2026-03-01 08:00:00+00\\\",\\\"2026-03-01 09:00:00+00\\\")\",\"notes\":\"semi-skimmed\",\"search\":\"'buy':1 'milk':2\"}, \n {\"id\":2,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Write report\",\"done\":false,\"priority\":3,\"tags\":[\"work\"],\"meta\":{\"kind\": \"work\", \"pages\": 12},\"due\":\"2026-03-05\",\"during\":\"[\\\"2026-03-02 09:00:00+00\\\",\\\"2026-03-05 17:00:00+00\\\")\",\"notes\":null,\"search\":\"'report':2 'write':1\"}, \n {\"id\":3,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Call the plumber\",\"done\":true,\"priority\":2,\"tags\":[\"home\"],\"meta\":{\"kind\": \"errand\"},\"due\":null,\"during\":null,\"notes\":\"about the leaking tap\",\"search\":\"'call':1 'plumber':3\"}, \n {\"id\":4,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Plan the holiday\",\"done\":false,\"priority\":null,\"tags\":[],\"meta\":null,\"due\":\"2026-06-30\",\"during\":null,\"notes\":null,\"search\":\"'holiday':3 'plan':1\"}, \n {\"id\":5,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Buy bread and milk\",\"done\":true,\"priority\":1,\"tags\":[\"shopping\"],\"meta\":{\"cost\": 4, \"kind\": \"errand\"},\"due\":\"2026-03-01\",\"during\":null,\"notes\":null,\"search\":\"'bread':2 'buy':1 'milk':4\"}, \n {\"id\":6,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Review pull requests\",\"done\":false,\"priority\":2,\"tags\":[\"work\",\"code\"],\"meta\":{\"kind\": \"work\"},\"due\":\"2026-03-03\",\"during\":\"[\\\"2026-03-03 10:00:00+00\\\",\\\"2026-03-03 12:00:00+00\\\")\",\"notes\":null,\"search\":\"'pull':2 'request':3 'review':1\"}, \n {\"id\":7,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Water the plants\",\"done\":false,\"priority\":1,\"tags\":[\"home\"],\"meta\":null,\"due\":null,\"during\":null,\"notes\":\"twice a week\",\"search\":\"'plant':3 'water':1\"}]","7",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > eq": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\" from \"todos\" as \"todos\" where \"todos\".\"priority\" = $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\",\"done\":false,\"priority\":1}, \n {\"id\":5,\"title\":\"Buy bread and milk\",\"done\":true,\"priority\":1}, \n {\"id\":7,\"title\":\"Water the plants\",\"done\":false,\"priority\":1}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > neq": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\" from \"todos\" as \"todos\" where \"todos\".\"priority\" <> $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2,\"title\":\"Write report\",\"done\":false,\"priority\":3}, \n {\"id\":3,\"title\":\"Call the plumber\",\"done\":true,\"priority\":2}, \n {\"id\":6,\"title\":\"Review pull requests\",\"done\":false,\"priority\":2}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > gt and lte": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\" from \"todos\" as \"todos\" where \"todos\".\"priority\" > $1 and \"todos\".\"priority\" <= $2 order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["1","2","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":3,\"title\":\"Call the plumber\",\"done\":true,\"priority\":2}, \n {\"id\":6,\"title\":\"Review pull requests\",\"done\":false,\"priority\":2}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > gte and lt on a date": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"due\" as \"due\" from \"todos\" as \"todos\" where \"todos\".\"due\" >= $1 and \"todos\".\"due\" < $2 order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["2026-03-02","2026-06-30","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2,\"due\":\"2026-03-05\"}, \n {\"id\":6,\"due\":\"2026-03-03\"}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > like with stars": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from \"todos\" as \"todos\" where \"todos\".\"title\" like $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["%milk%","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\"}, \n {\"id\":5,\"title\":\"Buy bread and milk\"}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > ilike": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from \"todos\" as \"todos\" where \"todos\".\"title\" ilike $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["buy%","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\"}, \n {\"id\":5,\"title\":\"Buy bread and milk\"}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > match and imatch": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from \"todos\" as \"todos\" where \"todos\".\"title\" ~ $1 and \"todos\".\"title\" ~* $2 order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["^[A-Z]","the","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":3,\"title\":\"Call the plumber\"}, \n {\"id\":4,\"title\":\"Plan the holiday\"}, \n {\"id\":7,\"title\":\"Water the plants\"}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > in with a quoted value": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from \"todos\" as \"todos\" where \"todos\".\"title\" = any($1) order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["{\"Buy milk\",\"Write report\",\"x\"}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\"}, \n {\"id\":2,\"title\":\"Write report\"}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > in with nothing": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"id\" = any($1) limit $2) as pgrst_rows\n ","params":["{}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[]","0",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > is null": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"priority\" is null limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":4}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > is true and is false": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"done\" is true order by \"todos\".\"id\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":3}, \n {\"id\":5}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > not.is.null": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where not (\"todos\".\"due\" is null) order by \"todos\".\"id\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":2}, \n {\"id\":4}, \n {\"id\":5}, \n {\"id\":6}]","5",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > isdistinct": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"priority\" is distinct from $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}, \n {\"id\":3}, \n {\"id\":4}, \n {\"id\":6}]","4",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > not.eq": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where not (\"todos\".\"done\" = $1) order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["true","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":2}, \n {\"id\":4}, \n {\"id\":6}, \n {\"id\":7}]","5",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > fts with a language": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from \"todos\" as \"todos\" where \"todos\".\"search\" @@ to_tsquery($1, $2) order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["english","milk & buy","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\"}, \n {\"id\":5,\"title\":\"Buy bread and milk\"}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > plfts": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"search\" @@ plainto_tsquery($1) order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["bread milk","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":5}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > phfts": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"search\" @@ phraseto_tsquery($1, $2) order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["english","the plumber","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":3}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > wfts": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"search\" @@ websearch_to_tsquery($1, $2) order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["english","milk -bread","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > cs on an array": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"tags\" as \"tags\" from \"todos\" as \"todos\" where \"todos\".\"tags\" @> $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["{home}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"tags\":[\"home\",\"shopping\"]}, \n {\"id\":3,\"tags\":[\"home\"]}, \n {\"id\":7,\"tags\":[\"home\"]}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > cd on an array": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"tags\" as \"tags\" from \"todos\" as \"todos\" where \"todos\".\"tags\" <@ $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["{home,shopping}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"tags\":[\"home\",\"shopping\"]}, \n {\"id\":3,\"tags\":[\"home\"]}, \n {\"id\":4,\"tags\":[]}, \n {\"id\":5,\"tags\":[\"shopping\"]}, \n {\"id\":7,\"tags\":[\"home\"]}]","5",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > ov on an array": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"tags\" && $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["{code,shopping}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":5}, \n {\"id\":6}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > cs on JSON": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"meta\" as \"meta\" from \"todos\" as \"todos\" where \"todos\".\"meta\" @> $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["{\"kind\":\"errand\"}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"meta\":{\"cost\": 3, \"kind\": \"errand\"}}, \n {\"id\":3,\"meta\":{\"kind\": \"errand\"}}, \n {\"id\":5,\"meta\":{\"cost\": 4, \"kind\": \"errand\"}}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > range operators": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"during\" << $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["[2026-03-04 00:00+00,2026-03-10 00:00+00)","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":6}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > adj": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"during\" -|- $1 limit $2) as pgrst_rows\n ","params":["[2026-03-01 09:00+00,2026-03-01 10:00+00)","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > nxr and nxl": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"during\" &< $1 and \"todos\".\"during\" &> $2 order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["[2026-03-01 00:00+00,2026-03-04 00:00+00)","[2026-03-01 00:00+00,2026-03-02 00:00+00)","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":6}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > a filter on a JSON path": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where (\"todos\".\"meta\"->>$1::text) = $2 order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["kind","work","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}, \n {\"id\":6}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > eq(any)": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"priority\" = any($1) order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["{1,3}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":2}, \n {\"id\":5}, \n {\"id\":7}]","4",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > like(all)": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"title\" like all($1) order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["{%Buy%,%milk%}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":5}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > or": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where (\"todos\".\"priority\" = $1 or \"todos\".\"done\" is true) order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["3","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}, \n {\"id\":3}, \n {\"id\":5}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > or with nested and, not and quoted values": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where (\"todos\".\"title\" = $1 or (\"todos\".\"priority\" >= $2 and not (\"todos\".\"done\" is true)) or not ((\"todos\".\"tags\" @> $3 and \"todos\".\"id\" > $4))) order by \"todos\".\"id\" limit $5) as pgrst_rows\n ","params":["Buy milk","3","{code,work}","2","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":2}, \n {\"id\":3}, \n {\"id\":4}, \n {\"id\":5}, \n {\"id\":7}]","6",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > not.or beside a filter": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where not ((\"todos\".\"priority\" = $1 or \"todos\".\"priority\" is null)) and \"todos\".\"done\" = $2 order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["1","false","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}, \n {\"id\":6}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > and with in": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where (\"todos\".\"priority\" = any($1) and \"todos\".\"title\" ilike $2) order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["{\"1\",\"2\"}","%the%","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":3}, \n {\"id\":7}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > aliases and casts": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"key\", \"todos\".\"title\" as \"title\", cast(\"todos\".\"priority\" as text) as \"priority\", cast(\"todos\".\"title\" as varchar) as \"label\" from \"todos\" as \"todos\" where \"todos\".\"id\" <= $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["2","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"key\":1,\"title\":\"Buy milk\",\"priority\":\"1\",\"label\":\"Buy milk\"}, \n {\"key\":2,\"title\":\"Write report\",\"priority\":\"3\",\"label\":\"Write report\"}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > JSON paths in select": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", (\"todos\".\"meta\"->$1::text) as \"kind\", (\"todos\".\"meta\"->>$2::text) as \"cost\", (\"todos\".\"meta\"->>$3::text) as \"pages\" from \"todos\" as \"todos\" where \"todos\".\"id\" <= $4 order by \"todos\".\"id\" limit $5) as pgrst_rows\n ","params":["kind","cost","pages","3","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"kind\":\"errand\",\"cost\":\"3\",\"pages\":null}, \n {\"id\":2,\"kind\":\"work\",\"cost\":null,\"pages\":\"12\"}, \n {\"id\":3,\"kind\":\"errand\",\"cost\":null,\"pages\":null}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > spaces in select": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from \"todos\" as \"todos\" where \"todos\".\"id\" = $1 limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\"}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > an unknown column": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"colour\" as \"colour\" from \"todos\" as \"todos\" limit $1) as pgrst_rows\n ","params":["1000"],"error":{"message":"column todos.colour does not exist","severity":"ERROR","code":"42703","position":"140"}}, {"sql":"commit","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > order desc nulls last and a second column": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"priority\" as \"priority\" from \"todos\" as \"todos\" order by \"todos\".\"priority\" desc nulls last, \"todos\".\"id\" asc limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2,\"priority\":3}, \n {\"id\":3,\"priority\":2}, \n {\"id\":6,\"priority\":2}, \n {\"id\":1,\"priority\":1}, \n {\"id\":5,\"priority\":1}, \n {\"id\":7,\"priority\":1}, \n {\"id\":4,\"priority\":null}]","7",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > order nulls first": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"priority\" as \"priority\" from \"todos\" as \"todos\" order by \"todos\".\"priority\" asc nulls first, \"todos\".\"id\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":4,\"priority\":null}, \n {\"id\":1,\"priority\":1}, \n {\"id\":5,\"priority\":1}, \n {\"id\":7,\"priority\":1}, \n {\"id\":3,\"priority\":2}, \n {\"id\":6,\"priority\":2}, \n {\"id\":2,\"priority\":3}]","7",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > limit and offset": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" order by \"todos\".\"id\" limit $1 offset $2) as pgrst_rows\n ","params":["2","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}, \n {\"id\":3}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > a Range header": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" order by \"todos\".\"id\" limit $1 offset $2) as pgrst_rows\n ","params":["3","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":3}, \n {\"id\":4}, \n {\"id\":5}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > an open Range header": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" order by \"todos\".\"id\" limit $1 offset $2) as pgrst_rows\n ","params":["1000","5"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":6}, \n {\"id\":7}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > count=exact over a page": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, (select count(*) from \"todos\" as \"todos\") as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" order by \"todos\".\"id\" limit $1) as pgrst_rows\n ","params":["2"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}, \n {\"id\":2}]","2","7"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > count=exact over all rows": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, (select count(*) from \"todos\" as \"todos\" where \"todos\".\"priority\" = $1) as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" where \"todos\".\"priority\" = $2 limit $3) as pgrst_rows\n ","params":["3","3","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}]","1","1"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > count=exact past the end": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, (select count(*) from \"todos\" as \"todos\") as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" limit $1 offset $2) as pgrst_rows\n ","params":["1000","20"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[]","0","7"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > count=exact with HEAD": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, (select count(*) from \"todos\" as \"todos\") as total from (select \"todos\".* from \"todos\" as \"todos\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Buy milk\",\"done\":false,\"priority\":1,\"tags\":[\"home\",\"shopping\"],\"meta\":{\"cost\": 3, \"kind\": \"errand\"},\"due\":\"2026-03-01\",\"during\":\"[\\\"2026-03-01 08:00:00+00\\\",\\\"2026-03-01 09:00:00+00\\\")\",\"notes\":\"semi-skimmed\",\"search\":\"'buy':1 'milk':2\"}, \n {\"id\":2,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Write report\",\"done\":false,\"priority\":3,\"tags\":[\"work\"],\"meta\":{\"kind\": \"work\", \"pages\": 12},\"due\":\"2026-03-05\",\"during\":\"[\\\"2026-03-02 09:00:00+00\\\",\\\"2026-03-05 17:00:00+00\\\")\",\"notes\":null,\"search\":\"'report':2 'write':1\"}, \n {\"id\":3,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Call the plumber\",\"done\":true,\"priority\":2,\"tags\":[\"home\"],\"meta\":{\"kind\": \"errand\"},\"due\":null,\"during\":null,\"notes\":\"about the leaking tap\",\"search\":\"'call':1 'plumber':3\"}, \n {\"id\":4,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Plan the holiday\",\"done\":false,\"priority\":null,\"tags\":[],\"meta\":null,\"due\":\"2026-06-30\",\"during\":null,\"notes\":null,\"search\":\"'holiday':3 'plan':1\"}, \n {\"id\":5,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Buy bread and milk\",\"done\":true,\"priority\":1,\"tags\":[\"shopping\"],\"meta\":{\"cost\": 4, \"kind\": \"errand\"},\"due\":\"2026-03-01\",\"during\":null,\"notes\":null,\"search\":\"'bread':2 'buy':1 'milk':4\"}, \n {\"id\":6,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Review pull requests\",\"done\":false,\"priority\":2,\"tags\":[\"work\",\"code\"],\"meta\":{\"kind\": \"work\"},\"due\":\"2026-03-03\",\"during\":\"[\\\"2026-03-03 10:00:00+00\\\",\\\"2026-03-03 12:00:00+00\\\")\",\"notes\":null,\"search\":\"'pull':2 'request':3 'review':1\"}, \n {\"id\":7,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Water the plants\",\"done\":false,\"priority\":1,\"tags\":[\"home\"],\"meta\":null,\"due\":null,\"during\":null,\"notes\":\"twice a week\",\"search\":\"'plant':3 'water':1\"}]","7","7"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > count=planned": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" order by \"todos\".\"id\" limit $1) as pgrst_rows\n ","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"explain (format json) select 1 from \"todos\" as \"todos\"","result":{"command":"EXPLAIN","rowCount":null,"columns":[["QUERY PLAN",114]],"rows":[["[\n {\n \"Plan\": {\n \"Node Type\": \"Seq Scan\",\n \"Parallel Aware\": false,\n \"Async Capable\": false,\n \"Relation Name\": \"todos\",\n \"Alias\": \"todos\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.10,\n \"Plan Rows\": 10,\n \"Plan Width\": 4,\n \"Disabled\": false\n }\n }\n]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > count=estimated": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, (select count(*) from \"todos\" as \"todos\") as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" order by \"todos\".\"id\" limit $1) as pgrst_rows\n ","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}]","1","10"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > one row as an object": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\" from \"todos\" as \"todos\" where \"todos\".\"id\" = $1 limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\",\"done\":false,\"priority\":1}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > no row as an object": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\" from \"todos\" as \"todos\" where \"todos\".\"id\" = $1 limit $2) as pgrst_rows\n ","params":["8","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[]","0",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > several rows as an object": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\" from \"todos\" as \"todos\" where \"todos\".\"priority\" = $1 limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\",\"done\":false,\"priority\":1}, \n {\"id\":5,\"title\":\"Buy bread and milk\",\"done\":true,\"priority\":1}, \n {\"id\":7,\"title\":\"Water the plants\",\"done\":false,\"priority\":1}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > a value of the wrong type": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".* from \"todos\" as \"todos\" where \"todos\".\"priority\" = $1 limit $2) as pgrst_rows\n ","params":["high","1000"],"error":{"message":"invalid input syntax for type integer: \"high\"","severity":"ERROR","code":"22P02","where":"unnamed portal parameter $1 = '...'"}}, {"sql":"commit","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > many-to-one": { "(hooks)#0": [ {"sql":"\n select c.conname::text as name, s.relname::text as table, t.relname::text as \"foreignTable\",\n array(select a.attname::text from unnest(c.conkey) with ordinality k(attnum, ord) join pg_attribute a on a.attrelid = c.conrelid and a.attnum = k.attnum order by k.ord) as columns,\n array(select a.attname::text from unnest(c.confkey) with ordinality k(attnum, ord) join pg_attribute a on a.attrelid = c.confrelid and a.attnum = k.attnum order by k.ord) as \"foreignColumns\",\n exists (select 1 from pg_constraint u where u.conrelid = c.conrelid and u.contype in ('p', 'u') and u.conkey @> c.conkey and u.conkey <@ c.conkey) as unique\n from pg_constraint c\n join pg_class s on s.oid = c.conrelid\n join pg_class t on t.oid = c.confrelid\n where c.contype = 'f' and s.relnamespace = 'public'::regnamespace and t.relnamespace = 'public'::regnamespace\n order by c.conname\n ","result":{"command":"SELECT","rowCount":7,"columns":[["name",25],["table",25],["foreignTable",25],["columns",1009],["foreignColumns",1009],["unique",16]],"rows":[ ["attachments_comment_id_fkey","attachments","comments","{comment_id}","{id}","f"], ["comments_author_id_fkey","comments","profiles","{author_id}","{id}","f"], ["comments_todo_id_fkey","comments","todos","{todo_id}","{id}","f"], ["messages_receiver_id_fkey","messages","profiles","{receiver_id}","{id}","f"], ["messages_sender_id_fkey","messages","profiles","{sender_id}","{id}","f"], ["profile_settings_profile_id_fkey","profile_settings","profiles","{profile_id}","{id}","t"], ["todos_user_id_fkey","todos","profiles","{user_id}","{id}","f"] ]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"pgrst_profiles_1\".body as \"profiles\" from \"todos\" as \"todos\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"username\" as \"username\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"todos\".\"user_id\") as pgrst_rows) as \"pgrst_profiles_1\" on true where \"todos\".\"id\" <= $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["3","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\",\"profiles\":{\"username\":\"alice\"}}, \n {\"id\":2,\"title\":\"Write report\",\"profiles\":{\"username\":\"alice\"}}, \n {\"id\":3,\"title\":\"Call the plumber\",\"profiles\":{\"username\":\"alice\"}}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > many-to-one with an alias and every column": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"pgrst_profiles_1\".body as \"owner\" from \"todos\" as \"todos\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".* from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"todos\".\"user_id\") as pgrst_rows) as \"pgrst_profiles_1\" on true where \"todos\".\"id\" = $1 limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"owner\":{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"username\":\"alice\",\"full_name\":\"Alice Adams\",\"website\":\"https://alice.example.com\"}}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > one-to-many under RLS": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"profiles\".\"username\" as \"username\", \"pgrst_todos_1\".body as \"todos\" from \"profiles\" as \"profiles\" left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"todos_1\".\"id\" as \"id\", \"todos_1\".\"title\" as \"title\" from \"todos\" as \"todos_1\" where \"todos_1\".\"user_id\" = \"profiles\".\"id\" order by \"todos_1\".\"id\") as pgrst_rows) as \"pgrst_todos_1\" on true order by \"profiles\".\"username\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"username\":\"alice\",\"todos\":[{\"id\":1,\"title\":\"Buy milk\"}, \n {\"id\":2,\"title\":\"Write report\"}, \n {\"id\":3,\"title\":\"Call the plumber\"}, \n {\"id\":4,\"title\":\"Plan the holiday\"}, \n {\"id\":5,\"title\":\"Buy bread and milk\"}, \n {\"id\":6,\"title\":\"Review pull requests\"}, \n {\"id\":7,\"title\":\"Water the plants\"}]}, \n {\"username\":\"bob\",\"todos\":[]}, \n {\"username\":\"carol\",\"todos\":[]}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > one-to-many as anon": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"profiles\".\"username\" as \"username\", \"pgrst_todos_1\".body as \"todos\" from \"profiles\" as \"profiles\" left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"todos_1\".\"id\" as \"id\" from \"todos\" as \"todos_1\" where \"todos_1\".\"user_id\" = \"profiles\".\"id\") as pgrst_rows) as \"pgrst_todos_1\" on true order by \"profiles\".\"username\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"username\":\"alice\",\"todos\":[]}, \n {\"username\":\"bob\",\"todos\":[]}, \n {\"username\":\"carol\",\"todos\":[]}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > nested embeds": { "(hooks)#0": [ {"sql":"select relkind from pg_class where oid = to_regclass($1)","params":["\"comments\""],"result":{"command":"SELECT","rowCount":1,"columns":[["relkind",18]],"rows":[["r"]]}}, {"sql":"\n select ic.relname as name, am.amname as method, (i.indpred is not null) as partial, a.attname::text as column,\n pg_get_indexdef(i.indexrelid, k.ord::int, true) as definition, oc.opcname::text as opclass\n from pg_index i\n join pg_class ic on ic.oid = i.indexrelid\n join pg_am am on am.oid = ic.relam\n cross join lateral unnest(i.indkey::int2[], i.indclass::oid[]) with ordinality k(attnum, opclass, ord)\n left join pg_attribute a on a.attrelid = i.indrelid and a.attnum = k.attnum and k.attnum > 0\n join pg_opclass oc on oc.oid = k.opclass\n where i.indrelid = to_regclass($1) and i.indisvalid and i.indisready and k.ord <= i.indnkeyatts\n order by ic.relname, k.ord\n ","params":["\"comments\""],"result":{"command":"SELECT","rowCount":5,"columns":[["name",19],["method",19],["partial",16],["column",25],["definition",25],["opclass",25]],"rows":[ ["comments_author_id_idx","btree","f","author_id","author_id","uuid_ops"], ["comments_likes_idx","btree","f","likes","likes","int4_ops"], ["comments_pkey","btree","f","id","id","int8_ops"], ["comments_todo_id_id_idx","btree","f","todo_id","todo_id","int8_ops"], ["comments_todo_id_id_idx","btree","f","id","id","int8_ops"] ]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"pgrst_comments_1\".body as \"comments\" from \"todos\" as \"todos\" left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"comments_1\".\"body\" as \"body\", \"pgrst_profiles_2\".body as \"author\" from \"comments\" as \"comments_1\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_2\".\"username\" as \"username\" from \"profiles\" as \"profiles_2\" where \"profiles_2\".\"id\" = \"comments_1\".\"author_id\") as pgrst_rows) as \"pgrst_profiles_2\" on true where \"comments_1\".\"todo_id\" = \"todos\".\"id\" order by \"comments_1\".\"id\") as pgrst_rows) as \"pgrst_comments_1\" on true where \"todos\".\"id\" <= $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["3","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"comments\":[{\"body\":\"Get oat milk too\",\"author\":{\"username\":\"alice\"}}, \n {\"body\":\"Skimmed please\",\"author\":{\"username\":\"bob\"}}]}, \n {\"id\":2,\"comments\":[{\"body\":\"Due Friday\",\"author\":{\"username\":\"bob\"}}]}, \n {\"id\":3,\"comments\":[{\"body\":\"Called twice\",\"author\":{\"username\":\"alice\"}}]}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > one-to-one from the referenced table": { "(hooks)#0": [ {"sql":"select relkind from pg_class where oid = to_regclass($1)","params":["\"profile_settings\""],"result":{"command":"SELECT","rowCount":1,"columns":[["relkind",18]],"rows":[["r"]]}}, {"sql":"\n select ic.relname as name, am.amname as method, (i.indpred is not null) as partial, a.attname::text as column,\n pg_get_indexdef(i.indexrelid, k.ord::int, true) as definition, oc.opcname::text as opclass\n from pg_index i\n join pg_class ic on ic.oid = i.indexrelid\n join pg_am am on am.oid = ic.relam\n cross join lateral unnest(i.indkey::int2[], i.indclass::oid[]) with ordinality k(attnum, opclass, ord)\n left join pg_attribute a on a.attrelid = i.indrelid and a.attnum = k.attnum and k.attnum > 0\n join pg_opclass oc on oc.oid = k.opclass\n where i.indrelid = to_regclass($1) and i.indisvalid and i.indisready and k.ord <= i.indnkeyatts\n order by ic.relname, k.ord\n ","params":["\"profile_settings\""],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["method",19],["partial",16],["column",25],["definition",25],["opclass",25]],"rows":[["profile_settings_pkey","btree","f","profile_id","profile_id","uuid_ops"]]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"profiles\".\"username\" as \"username\", \"pgrst_profile_settings_1\".body as \"profile_settings\" from \"profiles\" as \"profiles\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profile_settings_1\".\"theme\" as \"theme\" from \"profile_settings\" as \"profile_settings_1\" where \"profile_settings_1\".\"profile_id\" = \"profiles\".\"id\") as pgrst_rows) as \"pgrst_profile_settings_1\" on true order by \"profiles\".\"username\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"username\":\"alice\",\"profile_settings\":{\"theme\":\"dark\"}}, \n {\"username\":\"bob\",\"profile_settings\":{\"theme\":\"light\"}}, \n {\"username\":\"carol\",\"profile_settings\":null}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > one-to-one from the referencing table": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"profile_settings\".\"theme\" as \"theme\", \"pgrst_profiles_1\".body as \"profiles\" from \"profile_settings\" as \"profile_settings\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"username\" as \"username\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"profile_settings\".\"profile_id\") as pgrst_rows) as \"pgrst_profiles_1\" on true order by \"profile_settings\".\"profile_id\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"theme\":\"dark\",\"profiles\":{\"username\":\"alice\"}}, \n {\"theme\":\"light\",\"profiles\":{\"username\":\"bob\"}}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > a filter on an embedded table": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"pgrst_comments_1\".body as \"comments\" from \"todos\" as \"todos\" left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"comments_1\".\"id\" as \"id\", \"comments_1\".\"likes\" as \"likes\" from \"comments\" as \"comments_1\" where \"comments_1\".\"todo_id\" = \"todos\".\"id\" and \"comments_1\".\"likes\" >= $1) as pgrst_rows) as \"pgrst_comments_1\" on true where \"todos\".\"id\" <= $2 order by \"todos\".\"id\" limit $3) as pgrst_rows\n ","params":["2","3","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"comments\":[{\"id\":1,\"likes\":3}]}, \n {\"id\":2,\"comments\":[{\"id\":3,\"likes\":5}]}, \n {\"id\":3,\"comments\":[]}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > or on an embedded table": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"pgrst_comments_1\".body as \"comments\" from \"todos\" as \"todos\" left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"comments_1\".\"id\" as \"id\" from \"comments\" as \"comments_1\" where \"comments_1\".\"todo_id\" = \"todos\".\"id\" and (\"comments_1\".\"likes\" = $1 or \"comments_1\".\"likes\" >= $2) order by \"comments_1\".\"id\") as pgrst_rows) as \"pgrst_comments_1\" on true where \"todos\".\"id\" <= $3 order by \"todos\".\"id\" limit $4) as pgrst_rows\n ","params":["0","5","3","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"comments\":[{\"id\":2}]}, \n {\"id\":2,\"comments\":[{\"id\":3}]}, \n {\"id\":3,\"comments\":[]}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > order, limit and offset on an embedded table": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"pgrst_comments_1\".body as \"comments\" from \"todos\" as \"todos\" left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"comments_1\".\"id\" as \"id\" from \"comments\" as \"comments_1\" where \"comments_1\".\"todo_id\" = \"todos\".\"id\" order by \"comments_1\".\"id\" desc limit $1 offset $2) as pgrst_rows) as \"pgrst_comments_1\" on true where \"todos\".\"id\" <= $3 order by \"todos\".\"id\" limit $4) as pgrst_rows\n ","params":["1","1","3","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"comments\":[{\"id\":1}]}, \n {\"id\":2,\"comments\":[]}, \n {\"id\":3,\"comments\":[]}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > an inner embed": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"pgrst_comments_1\".body as \"comments\" from \"todos\" as \"todos\" inner join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"comments_1\".\"id\" as \"id\" from \"comments\" as \"comments_1\" where \"comments_1\".\"todo_id\" = \"todos\".\"id\" and \"comments_1\".\"likes\" >= $1) as pgrst_rows having count(*) > 0) as \"pgrst_comments_1\" on true order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["2","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"comments\":[{\"id\":1}]}, \n {\"id\":2,\"comments\":[{\"id\":3}]}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > an inner many-to-one filtered through its alias": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"comments\".\"id\" as \"id\", \"pgrst_profiles_1\".body as \"author\" from \"comments\" as \"comments\" inner join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"username\" as \"username\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"comments\".\"author_id\" and \"profiles_1\".\"username\" = $1) as pgrst_rows) as \"pgrst_profiles_1\" on true order by \"comments\".\"id\" limit $2) as pgrst_rows\n ","params":["bob","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2,\"author\":{\"username\":\"bob\"}}, \n {\"id\":3,\"author\":{\"username\":\"bob\"}}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > a many-to-one filtered to nothing": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"comments\".\"id\" as \"id\", \"pgrst_profiles_1\".body as \"profiles\" from \"comments\" as \"comments\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"username\" as \"username\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"comments\".\"author_id\" and \"profiles_1\".\"username\" = $1) as pgrst_rows) as \"pgrst_profiles_1\" on true order by \"comments\".\"id\" limit $2) as pgrst_rows\n ","params":["bob","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"profiles\":null}, \n {\"id\":2,\"profiles\":{\"username\":\"bob\"}}, \n {\"id\":3,\"profiles\":{\"username\":\"bob\"}}, \n {\"id\":4,\"profiles\":null}]","4",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > an empty embed": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\" from \"todos\" as \"todos\" left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select from \"comments\" as \"comments_1\" where \"comments_1\".\"todo_id\" = \"todos\".\"id\") as pgrst_rows) as \"pgrst_comments_1\" on true where \"todos\".\"id\" = $1 limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > an embed as an object": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"pgrst_profiles_1\".body as \"profiles\", \"pgrst_comments_2\".body as \"comments\" from \"todos\" as \"todos\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"username\" as \"username\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"todos\".\"user_id\") as pgrst_rows) as \"pgrst_profiles_1\" on true left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"comments_2\".\"id\" as \"id\" from \"comments\" as \"comments_2\" where \"comments_2\".\"todo_id\" = \"todos\".\"id\" order by \"comments_2\".\"id\") as pgrst_rows) as \"pgrst_comments_2\" on true where \"todos\".\"id\" = $1 limit $2) as pgrst_rows\n ","params":["1","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"profiles\":{\"username\":\"alice\"},\"comments\":[{\"id\":1}, \n {\"id\":2}]}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > hints by foreign key name": { "(hooks)#0": [ {"sql":"select relkind from pg_class where oid = to_regclass($1)","params":["\"messages\""],"result":{"command":"SELECT","rowCount":1,"columns":[["relkind",18]],"rows":[["r"]]}}, {"sql":"\n select ic.relname as name, am.amname as method, (i.indpred is not null) as partial, a.attname::text as column,\n pg_get_indexdef(i.indexrelid, k.ord::int, true) as definition, oc.opcname::text as opclass\n from pg_index i\n join pg_class ic on ic.oid = i.indexrelid\n join pg_am am on am.oid = ic.relam\n cross join lateral unnest(i.indkey::int2[], i.indclass::oid[]) with ordinality k(attnum, opclass, ord)\n left join pg_attribute a on a.attrelid = i.indrelid and a.attnum = k.attnum and k.attnum > 0\n join pg_opclass oc on oc.oid = k.opclass\n where i.indrelid = to_regclass($1) and i.indisvalid and i.indisready and k.ord <= i.indnkeyatts\n order by ic.relname, k.ord\n ","params":["\"messages\""],"result":{"command":"SELECT","rowCount":3,"columns":[["name",19],["method",19],["partial",16],["column",25],["definition",25],["opclass",25]],"rows":[ ["messages_pkey","btree","f","id","id","int8_ops"], ["messages_receiver_id_idx","btree","f","receiver_id","receiver_id","uuid_ops"], ["messages_sender_id_idx","btree","f","sender_id","sender_id","uuid_ops"] ]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"messages\".\"id\" as \"id\", \"pgrst_profiles_1\".body as \"from\", \"pgrst_profiles_2\".body as \"to\" from \"messages\" as \"messages\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"username\" as \"username\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"messages\".\"sender_id\") as pgrst_rows) as \"pgrst_profiles_1\" on true left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_2\".\"username\" as \"username\" from \"profiles\" as \"profiles_2\" where \"profiles_2\".\"id\" = \"messages\".\"receiver_id\") as pgrst_rows) as \"pgrst_profiles_2\" on true order by \"messages\".\"id\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"from\":{\"username\":\"alice\"},\"to\":{\"username\":\"bob\"}}, \n {\"id\":2,\"from\":{\"username\":\"bob\"},\"to\":{\"username\":\"alice\"}}, \n {\"id\":3,\"from\":{\"username\":\"carol\"},\"to\":{\"username\":\"alice\"}}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > a hint by column": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"messages\".\"id\" as \"id\", \"pgrst_profiles_1\".body as \"profiles\" from \"messages\" as \"messages\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"username\" as \"username\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"messages\".\"receiver_id\") as pgrst_rows) as \"pgrst_profiles_1\" on true order by \"messages\".\"id\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"profiles\":{\"username\":\"bob\"}}, \n {\"id\":2,\"profiles\":{\"username\":\"alice\"}}, \n {\"id\":3,\"profiles\":{\"username\":\"alice\"}}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > a hint on a one-to-many": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"profiles\".\"username\" as \"username\", \"pgrst_messages_1\".body as \"sent\" from \"profiles\" as \"profiles\" left join lateral (select coalesce(json_agg(pgrst_rows), '[]') as body from (select \"messages_1\".\"body\" as \"body\" from \"messages\" as \"messages_1\" where \"messages_1\".\"sender_id\" = \"profiles\".\"id\" order by \"messages_1\".\"id\") as pgrst_rows) as \"pgrst_messages_1\" on true order by \"profiles\".\"username\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"username\":\"alice\",\"sent\":[{\"body\":\"Hi Bob\"}]}, \n {\"username\":\"bob\",\"sent\":[{\"body\":\"Hi Alice\"}]}, \n {\"username\":\"carol\",\"sent\":[{\"body\":\"Lunch?\"}]}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > an unknown column in an embed": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"pgrst_profiles_1\".body as \"profiles\" from \"todos\" as \"todos\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"colour\" as \"colour\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"todos\".\"user_id\") as pgrst_rows) as \"pgrst_profiles_1\" on true limit $1) as pgrst_rows\n ","params":["1000"],"error":{"message":"column profiles_1.colour does not exist","severity":"ERROR","code":"42703","position":"273"}}, {"sql":"commit","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert one and return it": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\", \"priority\") select pgrst_body.\"title\", pgrst_body.\"priority\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"id\" as \"id\", \"todos\".\"user_id\" as \"user_id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\", \"todos\".\"tags\" as \"tags\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["[{\"title\":\"Pay rent\",\"priority\":2}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1",null,"[{\"id\":101,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Pay rent\",\"done\":false,\"priority\":2,\"tags\":[]}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert several, missing columns null": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\", \"priority\") select pgrst_body.\"title\", pgrst_body.\"priority\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"priority\" as \"priority\", \"todos\".\"done\" as \"done\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["[{\"title\":\"Read a book\",\"priority\":1},{\"title\":\"Go running\"}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["2",null,"[{\"id\":102,\"title\":\"Read a book\",\"priority\":1,\"done\":false}, \n {\"id\":103,\"title\":\"Go running\",\"priority\":null,\"done\":false}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert several, a missing column null against its constraint": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\", \"done\") select pgrst_body.\"title\", pgrst_body.\"done\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["[{\"title\":\"Swim\",\"done\":true},{\"title\":\"Cycle\"}]"],"error":{"message":"null value in column \"done\" of relation \"todos\" violates not-null constraint","severity":"ERROR","code":"23502","schema":"public","table":"todos","column":"done"}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert several, missing columns default": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\", \"done\", \"tags\") values ((json_populate_record(null::\"todos\", (select body -> 0 from pgrst_payload))).\"title\", (json_populate_record(null::\"todos\", (select body -> 0 from pgrst_payload))).\"done\", default), ((json_populate_record(null::\"todos\", (select body -> 1 from pgrst_payload))).\"title\", default, (json_populate_record(null::\"todos\", (select body -> 1 from pgrst_payload))).\"tags\") returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"tags\" as \"tags\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["[{\"title\":\"Bake a cake\",\"done\":true},{\"title\":\"Phone mum\",\"tags\":[\"family\"]}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["2",null,"[{\"id\":106,\"title\":\"Bake a cake\",\"done\":true,\"tags\":[]}, \n {\"id\":107,\"title\":\"Phone mum\",\"done\":false,\"tags\":[\"family\"]}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert with missing=default and an explicit null": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\", \"tags\") values ((json_populate_record(null::\"todos\", (select body -> 0 from pgrst_payload))).\"title\", (json_populate_record(null::\"todos\", (select body -> 0 from pgrst_payload))).\"tags\") returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"title\" as \"title\", \"todos\".\"tags\" as \"tags\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["[{\"title\":\"Paint the fence\",\"tags\":null}]"],"error":{"message":"null value in column \"tags\" of relation \"todos\" violates not-null constraint","severity":"ERROR","code":"23502","schema":"public","table":"todos","column":"tags"}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert returning an embed": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\") select pgrst_body.\"title\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"title\" as \"title\", \"pgrst_profiles_1\".body as \"profiles\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\" left join lateral (select row_to_json(pgrst_rows) as body from (select \"profiles_1\".\"username\" as \"username\" from \"profiles\" as \"profiles_1\" where \"profiles_1\".\"id\" = \"todos\".\"user_id\") as pgrst_rows) as \"pgrst_profiles_1\" on true) as pgrst_rows) as body\n ","params":["[{\"title\":\"Pay the bills\"}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1",null,"[{\"title\":\"Pay the bills\",\"profiles\":{\"username\":\"alice\"}}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert minimal": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\") select pgrst_body.\"title\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["[{\"title\":\"Wash the car\"}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1",null,null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert minimal with a count": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\") select pgrst_body.\"title\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["[{\"title\":\"Tidy up\"},{\"title\":\"Sleep\"}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["2",null,null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert as an object": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\", \"meta\") select pgrst_body.\"title\", pgrst_body.\"meta\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["[{\"title\":\"Feed the cat\",\"meta\":{\"kind\":\"pet\"}}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1",null,"[{\"id\":113,\"title\":\"Feed the cat\"}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert another user's row": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\", \"user_id\") select pgrst_body.\"title\", pgrst_body.\"user_id\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".* from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["[{\"title\":\"Sneaky\",\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000002\"}]"],"error":{"message":"new row violates row-level security policy for table \"todos\"","severity":"ERROR","code":"42501"}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert as anon": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"title\", \"user_id\") select pgrst_body.\"title\", pgrst_body.\"user_id\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["[{\"title\":\"Anonymous\",\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\"}]"],"error":{"message":"new row violates row-level security policy for table \"todos\"","severity":"ERROR","code":"42501"}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert without a required column": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"priority\") select pgrst_body.\"priority\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["[{\"priority\":1}]"],"error":{"message":"null value in column \"title\" of relation \"todos\" violates not-null constraint","severity":"ERROR","code":"23502","schema":"public","table":"todos","column":"title"}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > insert a duplicate": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"profiles\" as \"profiles\" (\"id\", \"username\") select pgrst_body.\"id\", pgrst_body.\"username\" from pgrst_payload, json_populate_recordset(null::\"profiles\", pgrst_payload.body) as pgrst_body returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["[{\"id\":\"1a1a1a1a-0000-0000-0000-000000000009\",\"username\":\"alice\"}]"],"error":{"message":"duplicate key value violates unique constraint \"profiles_username_key\"","severity":"ERROR","code":"23505","detail":"Key (username)=(alice) already exists.","schema":"public","table":"profiles","constraint":"profiles_username_key"}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > alice reads her todos after inserting": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\", \"todos\".\"tags\" as \"tags\", \"todos\".\"meta\" as \"meta\" from \"todos\" as \"todos\" where \"todos\".\"id\" > $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["10","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":101,\"title\":\"Pay rent\",\"done\":false,\"priority\":2,\"tags\":[],\"meta\":null}, \n {\"id\":102,\"title\":\"Read a book\",\"done\":false,\"priority\":1,\"tags\":[],\"meta\":null}, \n {\"id\":103,\"title\":\"Go running\",\"done\":false,\"priority\":null,\"tags\":[],\"meta\":null}, \n {\"id\":106,\"title\":\"Bake a cake\",\"done\":true,\"priority\":null,\"tags\":[],\"meta\":null}, \n {\"id\":107,\"title\":\"Phone mum\",\"done\":false,\"priority\":null,\"tags\":[\"family\"],\"meta\":null}, \n {\"id\":109,\"title\":\"Pay the bills\",\"done\":false,\"priority\":null,\"tags\":[],\"meta\":null}, \n {\"id\":110,\"title\":\"Wash the car\",\"done\":false,\"priority\":null,\"tags\":[],\"meta\":null}, \n {\"id\":111,\"title\":\"Tidy up\",\"done\":false,\"priority\":null,\"tags\":[],\"meta\":null}, \n {\"id\":112,\"title\":\"Sleep\",\"done\":false,\"priority\":null,\"tags\":[],\"meta\":null}, \n {\"id\":113,\"title\":\"Feed the cat\",\"done\":false,\"priority\":null,\"tags\":[],\"meta\":{\"kind\": \"pet\"}}]","10",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > upsert merging on a unique column": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"profiles\" as \"profiles\" (\"id\", \"username\", \"full_name\") select pgrst_body.\"id\", pgrst_body.\"username\", pgrst_body.\"full_name\" from pgrst_payload, json_populate_recordset(null::\"profiles\", pgrst_payload.body) as pgrst_body on conflict (\"username\") do update set \"id\" = excluded.\"id\", \"username\" = excluded.\"username\", \"full_name\" = excluded.\"full_name\" returning \"profiles\" as pgrst_row, (\"profiles\".xmax = 0) as pgrst_inserted)\n select (select count(*) from pgrst_source) as total, (select count(*) from pgrst_source where pgrst_inserted) as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"profiles\".\"username\" as \"username\", \"profiles\".\"full_name\" as \"full_name\", \"profiles\".\"website\" as \"website\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"profiles\") as pgrst_rows) as body\n ","params":["[{\"id\":\"1a1a1a1a-0000-0000-0000-000000000003\",\"username\":\"carol\",\"full_name\":\"Carol Clark\"},{\"id\":\"1a1a1a1a-0000-0000-0000-000000000004\",\"username\":\"dave\",\"full_name\":\"Dave Davis\"}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["2","1","[{\"username\":\"carol\",\"full_name\":\"Carol Clark\",\"website\":null}, \n {\"username\":\"dave\",\"full_name\":\"Dave Davis\",\"website\":null}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > upsert ignoring duplicates": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"profiles\" as \"profiles\" (\"id\", \"username\", \"full_name\") select pgrst_body.\"id\", pgrst_body.\"username\", pgrst_body.\"full_name\" from pgrst_payload, json_populate_recordset(null::\"profiles\", pgrst_payload.body) as pgrst_body on conflict (\"username\") do nothing returning \"profiles\" as pgrst_row, (\"profiles\".xmax = 0) as pgrst_inserted)\n select (select count(*) from pgrst_source) as total, (select count(*) from pgrst_source where pgrst_inserted) as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"profiles\".* from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"profiles\") as pgrst_rows) as body\n ","params":["[{\"id\":\"1a1a1a1a-0000-0000-0000-000000000003\",\"username\":\"carol\",\"full_name\":\"Not Carol\"},{\"id\":\"1a1a1a1a-0000-0000-0000-000000000005\",\"username\":\"erin\"}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1","1","[{\"id\":\"1a1a1a1a-0000-0000-0000-000000000005\",\"username\":\"erin\",\"full_name\":null,\"website\":null}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > upsert on the primary key": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"id\", \"title\", \"done\") select pgrst_body.\"id\", pgrst_body.\"title\", pgrst_body.\"done\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body on conflict (\"id\") do update set \"id\" = excluded.\"id\", \"title\" = excluded.\"title\", \"done\" = excluded.\"done\" returning \"todos\" as pgrst_row, (\"todos\".xmax = 0) as pgrst_inserted)\n select (select count(*) from pgrst_source) as total, (select count(*) from pgrst_source where pgrst_inserted) as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["[{\"id\":4,\"title\":\"Plan the summer holiday\",\"done\":false}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1","0","[{\"id\":4,\"title\":\"Plan the summer holiday\",\"done\":false}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > upsert minimal": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"id\", \"title\", \"done\") select pgrst_body.\"id\", pgrst_body.\"title\", pgrst_body.\"done\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body on conflict (\"id\") do update set \"id\" = excluded.\"id\", \"title\" = excluded.\"title\", \"done\" = excluded.\"done\" returning 1 as pgrst_one, (\"todos\".xmax = 0) as pgrst_inserted)\n select (select count(*) from pgrst_source) as total, (select count(*) from pgrst_source where pgrst_inserted) as inserted, null::text as body\n ","params":["[{\"id\":4,\"title\":\"Plan the summer holiday\",\"done\":false}]"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1","0",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > upsert of another user's row": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (insert into \"todos\" as \"todos\" (\"id\", \"title\") select pgrst_body.\"id\", pgrst_body.\"title\" from pgrst_payload, json_populate_recordset(null::\"todos\", pgrst_payload.body) as pgrst_body on conflict (\"id\") do update set \"id\" = excluded.\"id\", \"title\" = excluded.\"title\" returning 1 as pgrst_one, (\"todos\".xmax = 0) as pgrst_inserted)\n select (select count(*) from pgrst_source) as total, (select count(*) from pgrst_source where pgrst_inserted) as inserted, null::text as body\n ","params":["[{\"id\":8,\"title\":\"Mine now\"}]"],"error":{"message":"new row violates row-level security policy (USING expression) for table \"todos\"","severity":"ERROR","code":"42501"}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > update and return": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (update \"todos\" as \"todos\" set \"done\" = pgrst_body.\"done\", \"priority\" = pgrst_body.\"priority\" from json_populate_record(null::\"todos\", (select body from pgrst_payload)) as pgrst_body where \"todos\".\"id\" = $2 returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["{\"done\":true,\"priority\":2}","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1",null,"[{\"id\":1,\"title\":\"Buy milk\",\"done\":true,\"priority\":2}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > update minimal": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (update \"todos\" as \"todos\" set \"tags\" = pgrst_body.\"tags\" from json_populate_record(null::\"todos\", (select body from pgrst_payload)) as pgrst_body where \"todos\".\"id\" = any($2) returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["{\"tags\":[\"work\",\"urgent\"]}","{\"2\",\"6\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["2",null,null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > update minimal with a count": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (update \"todos\" as \"todos\" set \"notes\" = pgrst_body.\"notes\" from json_populate_record(null::\"todos\", (select body from pgrst_payload)) as pgrst_body where \"todos\".\"priority\" = $2 returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["{\"notes\":\"soon\"}","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["3",null,null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > update another user's row": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (update \"todos\" as \"todos\" set \"title\" = pgrst_body.\"title\" from json_populate_record(null::\"todos\", (select body from pgrst_payload)) as pgrst_body where \"todos\".\"id\" = $2 returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".* from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["{\"title\":\"Mine now\"}","8"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["0",null,"[]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > update several rows as an object": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (update \"todos\" as \"todos\" set \"title\" = pgrst_body.\"title\" from json_populate_record(null::\"todos\", (select body from pgrst_payload)) as pgrst_body where \"todos\".\"done\" is true returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".* from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["{\"title\":\"Done\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["4",null,"[{\"id\":3,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Done\",\"done\":true,\"priority\":2,\"tags\":[\"home\"],\"meta\":{\"kind\": \"errand\"},\"due\":null,\"during\":null,\"notes\":\"about the leaking tap\",\"search\":\"'done':1\"}, \n {\"id\":106,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Done\",\"done\":true,\"priority\":null,\"tags\":[],\"meta\":null,\"due\":null,\"during\":null,\"notes\":null,\"search\":\"'done':1\"}, \n {\"id\":1,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Done\",\"done\":true,\"priority\":2,\"tags\":[\"home\",\"shopping\"],\"meta\":{\"cost\": 3, \"kind\": \"errand\"},\"due\":\"2026-03-01\",\"during\":\"[\\\"2026-03-01 08:00:00+00\\\",\\\"2026-03-01 09:00:00+00\\\")\",\"notes\":\"semi-skimmed\",\"search\":\"'done':1\"}, \n {\"id\":5,\"user_id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"title\":\"Done\",\"done\":true,\"priority\":1,\"tags\":[\"shopping\"],\"meta\":{\"cost\": 4, \"kind\": \"errand\"},\"due\":\"2026-03-01\",\"during\":null,\"notes\":\"soon\",\"search\":\"'done':1\"}]"]]}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > the object update rolled back": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\", \"todos\".\"done\" as \"done\", \"todos\".\"priority\" as \"priority\", \"todos\".\"tags\" as \"tags\", \"todos\".\"notes\" as \"notes\" from \"todos\" as \"todos\" order by \"todos\".\"id\" limit $1) as pgrst_rows\n ","params":["7"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\",\"done\":true,\"priority\":2,\"tags\":[\"home\",\"shopping\"],\"notes\":\"semi-skimmed\"}, \n {\"id\":2,\"title\":\"Write report\",\"done\":false,\"priority\":3,\"tags\":[\"work\",\"urgent\"],\"notes\":null}, \n {\"id\":3,\"title\":\"Call the plumber\",\"done\":true,\"priority\":2,\"tags\":[\"home\"],\"notes\":\"about the leaking tap\"}, \n {\"id\":4,\"title\":\"Plan the summer holiday\",\"done\":false,\"priority\":null,\"tags\":[],\"notes\":null}, \n {\"id\":5,\"title\":\"Buy bread and milk\",\"done\":true,\"priority\":1,\"tags\":[\"shopping\"],\"notes\":\"soon\"}, \n {\"id\":6,\"title\":\"Review pull requests\",\"done\":false,\"priority\":2,\"tags\":[\"work\",\"urgent\"],\"notes\":null}, \n {\"id\":7,\"title\":\"Water the plants\",\"done\":false,\"priority\":1,\"tags\":[\"home\"],\"notes\":\"soon\"}]","7",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > delete and return": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (delete from \"todos\" as \"todos\" where \"todos\".\"id\" = $2 returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["null","7"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1",null,"[{\"id\":7,\"title\":\"Water the plants\"}]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > delete minimal": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (delete from \"todos\" as \"todos\" where \"todos\".\"title\" = $2 returning 1 as pgrst_one)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, null::text as body\n ","params":["null","Sleep"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["1",null,null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > delete another user's row": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n with pgrst_payload as (select $1::json as body), pgrst_source as (delete from \"todos\" as \"todos\" where \"todos\".\"id\" = $2 returning \"todos\" as pgrst_row)\n select (select count(*) from pgrst_source) as total, null::bigint as inserted, (select coalesce(json_agg(pgrst_rows), '[]')::text from (select \"todos\".* from (select (pgrst_source.pgrst_row).* from pgrst_source) as \"todos\") as pgrst_rows) as body\n ","params":["null","9"],"result":{"command":"SELECT","rowCount":1,"columns":[["total",20],["inserted",20],["body",25]],"rows":[["0",null,"[]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > bob still has his todos": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todos\".\"id\" as \"id\", \"todos\".\"title\" as \"title\" from \"todos\" as \"todos\" where \"todos\".\"user_id\" = $1 order by \"todos\".\"id\" limit $2) as pgrst_rows\n ","params":["1a1a1a1a-0000-0000-0000-000000000002","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":8,\"title\":\"Fix the bike\"}, \n {\"id\":9,\"title\":\"Buy milk\"}, \n {\"id\":10,\"title\":\"Prepare the talk\"}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc by POST": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["add"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["add","{a,b}",null,"0","{integer,integer}","integer","b","f"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows.pgrst_scalar), '[]')::text as body, count(*) as page, null::bigint as total from (select \"add\" as pgrst_scalar from json_to_record($1::json) as pgrst_args(\"a\" integer, \"b\" integer) cross join lateral \"public\".\"add\"(\"a\" := pgrst_args.\"a\", \"b\" := pgrst_args.\"b\") as \"add\" limit $2) as pgrst_rows\n ","params":["{\"a\":1,\"b\":2}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[3]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc by GET": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["add"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["add","{a,b}",null,"0","{integer,integer}","integer","b","f"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows.pgrst_scalar), '[]')::text as body, count(*) as page, null::bigint as total from (select \"add\" as pgrst_scalar from json_to_record($1::json) as pgrst_args(\"a\" integer, \"b\" integer) cross join lateral \"public\".\"add\"(\"a\" := pgrst_args.\"a\", \"b\" := pgrst_args.\"b\") as \"add\" limit $2) as pgrst_rows\n ","params":["{\"a\":\"40\",\"b\":\"2\"}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[42]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc under RLS": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["todo_count"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["todo_count",null,null,"0","{}","bigint","b","f"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows.pgrst_scalar), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todo_count\" as pgrst_scalar from \"public\".\"todo_count\"() as \"todo_count\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[15]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc under RLS as anon": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["todo_count"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["todo_count",null,null,"0","{}","bigint","b","f"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows.pgrst_scalar), '[]')::text as body, count(*) as page, null::bigint as total from (select \"todo_count\" as pgrst_scalar from \"public\".\"todo_count\"() as \"todo_count\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[0]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc returning rows, shaped": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["open_todos"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["open_todos","{min_priority}",null,"1","{integer}","todos","c","t"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"open_todos\".\"id\" as \"id\", \"open_todos\".\"title\" as \"title\" from json_to_record($1::json) as pgrst_args(\"min_priority\" integer) cross join lateral \"public\".\"open_todos\"(\"min_priority\" := pgrst_args.\"min_priority\") as \"open_todos\" order by \"open_todos\".\"id\" desc limit $2) as pgrst_rows\n ","params":["{\"min_priority\":2}","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":101,\"title\":\"Pay rent\"}, \n {\"id\":6,\"title\":\"Review pull requests\"}]","2",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc returning rows, filtered": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["open_todos"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["open_todos","{min_priority}",null,"1","{integer}","todos","c","t"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"open_todos\".\"id\" as \"id\" from \"public\".\"open_todos\"() as \"open_todos\" where \"open_todos\".\"id\" < $1 order by \"open_todos\".\"id\" limit $2) as pgrst_rows\n ","params":["100","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}, \n {\"id\":4}, \n {\"id\":6}]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc returning rows with a count": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["open_todos"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["open_todos","{min_priority}",null,"1","{integer}","todos","c","t"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, (select count(*) from \"public\".\"open_todos\"() as \"open_todos\") as total from (select \"open_todos\".\"id\" as \"id\" from \"public\".\"open_todos\"() as \"open_todos\" order by \"open_todos\".\"id\" limit $1) as pgrst_rows\n ","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}]","1","11"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc returning a table": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["usernames"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["usernames","{prefix,id,username}","{i,t,t}","0","{text}","record","p","t"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"usernames\".* from json_to_record($1::json) as pgrst_args(\"prefix\" text) cross join lateral \"public\".\"usernames\"(\"prefix\" := pgrst_args.\"prefix\") as \"usernames\" limit $2) as pgrst_rows\n ","params":["{\"prefix\":\"c\"}","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":\"1a1a1a1a-0000-0000-0000-000000000003\",\"username\":\"carol\"}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc returning one row": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["first_todo"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["first_todo",null,null,"0","{}","todos","c","f"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"first_todo\".\"id\" as \"id\", \"first_todo\".\"title\" as \"title\" from \"public\".\"first_todo\"() as \"first_todo\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":1,\"title\":\"Buy milk\"}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc returning scalars": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["priorities"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["priorities",null,null,"0","{}","integer","b","t"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows.pgrst_scalar), '[]')::text as body, count(*) as page, null::bigint as total from (select \"priorities\" as pgrst_scalar from \"public\".\"priorities\"() as \"priorities\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[1, 2, 3]","3",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc returning rows as an object": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["open_todos"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["open_todos","{min_priority}",null,"1","{integer}","todos","c","t"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows), '[]')::text as body, count(*) as page, null::bigint as total from (select \"open_todos\".\"id\" as \"id\" from \"public\".\"open_todos\"() as \"open_todos\" where \"open_todos\".\"id\" = $1 limit $2) as pgrst_rows\n ","params":["2","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"id\":2}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc returning void": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["finish_todo"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["finish_todo","{todo_id}",null,"0","{bigint}","void","p","f"]]}}, {"sql":"select 1 from json_to_record($1::json) as pgrst_args(\"todo_id\" bigint) cross join lateral \"public\".\"finish_todo\"(\"todo_id\" := pgrst_args.\"todo_id\") as \"finish_todo\"","params":["{\"todo_id\":2}"],"result":{"command":"SELECT","rowCount":1,"columns":[["?column?",23]],"rows":[["1"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc that writes, by GET": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["finish_todo"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["finish_todo","{todo_id}",null,"0","{bigint}","void","p","f"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true)","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001"]]}}, {"sql":"select 1 from json_to_record($1::json) as pgrst_args(\"todo_id\" bigint) cross join lateral \"public\".\"finish_todo\"(\"todo_id\" := pgrst_args.\"todo_id\") as \"finish_todo\"","params":["{\"todo_id\":\"6\"}"],"error":{"message":"cannot execute UPDATE in a read-only transaction","severity":"ERROR","code":"25006","where":"SQL function \"finish_todo\" statement 1"}}, {"sql":"commit","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc reading the claims as alice": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["whoami"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["whoami",null,null,"0","{}","jsonb","b","f"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows.pgrst_scalar), '[]')::text as body, count(*) as page, null::bigint as total from (select \"whoami\" as pgrst_scalar from \"public\".\"whoami\"() as \"whoami\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"uid\": \"1a1a1a1a-0000-0000-0000-000000000001\", \"role\": \"authenticated\"}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc reading the claims as anon": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true)","params":["statement_timeout","1000","role","anon","request.jwt.claims","{\"role\":\"anon\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25]],"rows":[["1s","anon","{\"role\":\"anon\"}"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["whoami"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["whoami",null,null,"0","{}","jsonb","b","f"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows.pgrst_scalar), '[]')::text as body, count(*) as page, null::bigint as total from (select \"whoami\" as pgrst_scalar from \"public\".\"whoami\"() as \"whoami\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"uid\": null, \"role\": \"anon\"}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > rpc reading the claims with the secret key": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["whoami"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["whoami",null,null,"0","{}","jsonb","b","f"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true)","params":["statement_timeout","1000","request.jwt.claims","{\"role\":\"service_role\"}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25]],"rows":[["1s","{\"role\":\"service_role\"}"]]}}, {"sql":"\n select coalesce(json_agg(pgrst_rows.pgrst_scalar), '[]')::text as body, count(*) as page, null::bigint as total from (select \"whoami\" as pgrst_scalar from \"public\".\"whoami\"() as \"whoami\" limit $1) as pgrst_rows\n ","params":["1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["body",25],["page",20],["total",20]],"rows":[["[{\"uid\": null, \"role\": \"service_role\"}]","1",null]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > an unknown function": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["nothing_here"],"result":{"command":"SELECT","rowCount":0,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[]}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 answers as PostgREST does > a function called with other arguments": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), set_config($3, $4, true), set_config($5, $6, true), set_config($7, $8, true), pg_logical_emit_message(true, $9, $10::text) is not null","params":["statement_timeout","1000","role","authenticated","request.jwt.claims","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","request.jwt.claim.sub","1a1a1a1a-0000-0000-0000-000000000001","protobase_actor","{\"id\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"roles\":[]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["set_config",25],["set_config",25],["set_config",25],["?column?",16]],"rows":[["1s","authenticated","{\"email\":\"alice@example.com\",\"sub\":\"1a1a1a1a-0000-0000-0000-000000000001\",\"exp\":1785542700,\"role\":\"authenticated\"}","1a1a1a1a-0000-0000-0000-000000000001","t"]]}}, {"sql":"\n select p.proname as name, p.proargnames as arg_names, p.proargmodes::text[] as arg_modes, p.pronargdefaults::int as defaults,\n array(select format_type(t.oid, null) from unnest(p.proargtypes::oid[]) with ordinality as t(oid, i) order by t.i) as input_types,\n format_type(p.prorettype, null) as returns, r.typtype as return_kind, p.proretset as set\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace join pg_type r on r.oid = p.prorettype\n where n.nspname = 'public' and p.proname = $1 and p.prokind = 'f'\n order by p.oid\n ","params":["add"],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["arg_names",1009],["arg_modes",1009],["defaults",23],["input_types",1009],["returns",25],["return_kind",18],["set",16]],"rows":[["add","{a,b}",null,"0","{integer,integer}","integer","b","f"]]}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "/api/sb/rest/v1 beyond PostgREST > refuses an embed through a foreign key no index serves, and a filter on an embedded column no index serves": { "(hooks)#0": [ {"sql":"select relkind from pg_class where oid = to_regclass($1)","params":["\"attachments\""],"result":{"command":"SELECT","rowCount":1,"columns":[["relkind",18]],"rows":[["r"]]}}, {"sql":"\n select ic.relname as name, am.amname as method, (i.indpred is not null) as partial, a.attname::text as column,\n pg_get_indexdef(i.indexrelid, k.ord::int, true) as definition, oc.opcname::text as opclass\n from pg_index i\n join pg_class ic on ic.oid = i.indexrelid\n join pg_am am on am.oid = ic.relam\n cross join lateral unnest(i.indkey::int2[], i.indclass::oid[]) with ordinality k(attnum, opclass, ord)\n left join pg_attribute a on a.attrelid = i.indrelid and a.attnum = k.attnum and k.attnum > 0\n join pg_opclass oc on oc.oid = k.opclass\n where i.indrelid = to_regclass($1) and i.indisvalid and i.indisready and k.ord <= i.indnkeyatts\n order by ic.relname, k.ord\n ","params":["\"attachments\""],"result":{"command":"SELECT","rowCount":1,"columns":[["name",19],["method",19],["partial",16],["column",25],["definition",25],["opclass",25]],"rows":[["attachments_pkey","btree","f","id","id","int8_ops"]]}} ] } }