Skip to content

Commit 16caa2c

Browse files
committed
test: clarify comments
1 parent 2cbbd26 commit 16caa2c

2 files changed

Lines changed: 2 additions & 27 deletions

File tree

test/expected/postgrest.out

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ create function getproject(id int) returns setof projects
66
$_$;
77
\echo
88

9-
-- this is postgREST CSV query, it produces the same result as our `csv_agg` (see other test)
9+
-- this is postgREST CSV query, it produces the same result as our `csv_agg` (see ../expected/sanity.out)
1010
WITH pgrst_source AS (
1111
SELECT "projects".* FROM "projects"
1212
)
@@ -31,21 +31,6 @@ FROM ( SELECT * FROM pgrst_source ) _postgrest_t;
3131
CRLF""",8
3232
(1 row)
3333

34-
-- postgREST CSV query with a filter
35-
WITH pgrst_source AS (
36-
SELECT "projects".* FROM "projects" WHERE "projects"."id" = 2
37-
)
38-
SELECT
39-
(SELECT coalesce(string_agg(a.k, ','), '') FROM (SELECT json_object_keys(r)::text as k FROM (SELECT row_to_json(hh) as r from pgrst_source as hh limit 1) _) a) ||
40-
E'\n' ||
41-
coalesce(string_agg(substring(_postgrest_t::text, 2, length(_postgrest_t::text) - 2), E'\n'), '') AS body
42-
FROM ( SELECT * FROM pgrst_source ) _postgrest_t;
43-
body
44-
-------------------
45-
id,name,client_id+
46-
2,"has,comma",1
47-
(1 row)
48-
4934
-- postgREST CSV query with RPC and a filter, it selects columns in a particular order (client_id, id, name)
5035
-- and it produces out of order CSV header names
5136
WITH pgrst_source AS (

test/sql/postgrest.sql

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ create function getproject(id int) returns setof projects
66
$_$;
77
\echo
88

9-
-- this is postgREST CSV query, it produces the same result as our `csv_agg` (see other test)
9+
-- this is postgREST CSV query, it produces the same result as our `csv_agg` (see ../expected/sanity.out)
1010
WITH pgrst_source AS (
1111
SELECT "projects".* FROM "projects"
1212
)
@@ -16,16 +16,6 @@ SELECT
1616
coalesce(string_agg(substring(_postgrest_t::text, 2, length(_postgrest_t::text) - 2), E'\n'), '') AS body
1717
FROM ( SELECT * FROM pgrst_source ) _postgrest_t;
1818

19-
-- postgREST CSV query with a filter
20-
WITH pgrst_source AS (
21-
SELECT "projects".* FROM "projects" WHERE "projects"."id" = 2
22-
)
23-
SELECT
24-
(SELECT coalesce(string_agg(a.k, ','), '') FROM (SELECT json_object_keys(r)::text as k FROM (SELECT row_to_json(hh) as r from pgrst_source as hh limit 1) _) a) ||
25-
E'\n' ||
26-
coalesce(string_agg(substring(_postgrest_t::text, 2, length(_postgrest_t::text) - 2), E'\n'), '') AS body
27-
FROM ( SELECT * FROM pgrst_source ) _postgrest_t;
28-
2919
-- postgREST CSV query with RPC and a filter, it selects columns in a particular order (client_id, id, name)
3020
-- and it produces out of order CSV header names
3121
WITH pgrst_source AS (

0 commit comments

Comments
 (0)