{ "(repeated)": [ {"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":["\"ledger\""],"result":{"command":"SELECT","rowCount":9,"columns":[["name",19],["method",19],["partial",16],["column",25],["definition",25],["opclass",25]],"rows":[ ["ledger_organization_id_secret_idx","btree","f","organization_id","organization_id","int4_ops"], ["ledger_organization_id_secret_idx","btree","f","secret","secret","text_ops"], ["ledger_organization_id_status_idx","btree","f","organization_id","organization_id","int4_ops"], ["ledger_organization_id_status_idx","btree","f","status","status","text_ops"], ["ledger_organization_id_title_idx","btree","f","organization_id","organization_id","int4_ops"], ["ledger_organization_id_title_idx","btree","f","title","title","text_ops"], ["ledger_pkey","btree","f","id","id","int4_ops"], ["ledger_title_secret_idx","gin","f","title","title","gin_trgm_ops"], ["ledger_title_secret_idx","gin","f","secret","secret","gin_trgm_ops"] ]}} ], "(hooks)": { "(hooks)#0": [ {"sql":"\n create table ledger (id integer generated always as identity primary key, organization_id integer not null, title text not null, secret text not null, status text not null default 'open');\n insert into ledger (organization_id, title, secret, status) values (1, 'visible one', 'alpha-secret', 'open'), (1, 'visible two', 'beta-secret', 'locked');\n create index on ledger (organization_id, title);\n create index on ledger (organization_id, secret);\n create index on ledger (organization_id, status);\n create index on ledger using gin (title gin_trgm_ops, secret gin_trgm_ops);\n ","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":2,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]}]} ] }, "a field the caller cannot read > is not searched, listed, offered in views, documents or meta": { "(hooks)#0": [ {"sql":"select relkind from pg_class where oid = to_regclass($1)","params":["\"ledger\""],"result":{"command":"SELECT","rowCount":1,"columns":[["relkind",18]],"rows":[["r"]]}}, {"repeated":0}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"secret\" as \"secret\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2) or (\"t\".\"secret\"::text is not null and \"t\".\"secret\"::text ilike $3))) order by \"t\".\"id\" asc limit $4","params":["1","%alpha-secret%","%alpha-secret%","51"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25],["__pb_key0",25]],"rows":[["1","1","visible one","alpha-secret","open","1"]]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2) or (\"t\".\"secret\"::text is not null and \"t\".\"secret\"::text ilike $3)))","params":["1","%alpha-secret%","%alpha-secret%"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.03,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"((t.organization_id = 1) AND (((t.title IS NOT NULL) AND (t.title ~~* '%alpha-secret%'::text)) OR ((t.secret IS NOT NULL) AND (t.secret ~~* '%alpha-secret%'::text))))\"\n }\n }\n]"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2))) order by \"t\".\"id\" asc limit $3","params":["1","%alpha-secret%","51"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",23],["organizationId",23],["title",25],["status",25],["__pb_key0",25]],"rows":[]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2)))","params":["1","%alpha-secret%"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.03,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"((t.title ~~* '%alpha-secret%'::text) AND (t.organization_id = 1))\"\n }\n }\n]"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2))) order by \"t\".\"id\" asc limit $3","params":["1","%visible%","51"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["status",25],["__pb_key0",25]],"rows":[ ["1","1","visible one","open","1"], ["2","1","visible two","locked","2"] ]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2)))","params":["1","%visible%"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.03,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"((t.title ~~* '%visible%'::text) AND (t.organization_id = 1))\"\n }\n }\n]"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2), ($3))","params":["1","1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[ ["1","1","visible one","alpha-secret","open"], ["2","1","visible two","beta-secret","locked"] ]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2), ($3))","params":["1","1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[ ["1","1","visible one","alpha-secret","open"], ["2","1","visible two","beta-secret","locked"] ]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"secret\" as \"secret\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2) or (\"t\".\"secret\"::text is not null and \"t\".\"secret\"::text ilike $3))) order by \"t\".\"id\" asc limit $4","params":["1","%secr%","%secr%","51"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25],["__pb_key0",25]],"rows":[ ["1","1","visible one","alpha-secret","open","1"], ["2","1","visible two","beta-secret","locked","2"] ]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2) or (\"t\".\"secret\"::text is not null and \"t\".\"secret\"::text ilike $3)))","params":["1","%secr%","%secr%"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.03,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"((t.organization_id = 1) AND (((t.title IS NOT NULL) AND (t.title ~~* '%secr%'::text)) OR ((t.secret IS NOT NULL) AND (t.secret ~~* '%secr%'::text))))\"\n }\n }\n]"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2), ($3))","params":["1","1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[ ["1","1","visible one","alpha-secret","open"], ["2","1","visible two","beta-secret","locked"] ]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2), ($3))","params":["1","1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[ ["1","1","visible one","alpha-secret","open"], ["2","1","visible two","beta-secret","locked"] ]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2))) order by \"t\".\"id\" asc limit $3","params":["1","%secr%","51"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",23],["organizationId",23],["title",25],["status",25],["__pb_key0",25]],"rows":[]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2)))","params":["1","%secr%"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.03,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"((t.title ~~* '%secr%'::text) AND (t.organization_id = 1))\"\n }\n }\n]"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2)) and ((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $3))) order by \"t\".\"id\" asc limit $4","params":["1","%VIS%","%two%","51"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["status",25],["__pb_key0",25]],"rows":[["2","1","visible two","locked","2"]]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 and (((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $2)) and ((\"t\".\"title\"::text is not null and \"t\".\"title\"::text ilike $3)))","params":["1","%VIS%","%two%"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.03,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"((t.title ~~* '%VIS%'::text) AND (t.title ~~* '%two%'::text) AND (t.organization_id = 1))\"\n }\n }\n]"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 order by \"t\".\"id\" asc limit $2","params":["1","51"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["status",25],["__pb_key0",25]],"rows":[ ["1","1","visible one","open","1"], ["2","1","visible two","locked","2"] ]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1","params":["1"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.02,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"(t.organization_id = 1)\"\n }\n }\n]"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2), ($3))","params":["1","1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[ ["1","1","visible one","alpha-secret","open"], ["2","1","visible two","beta-secret","locked"] ]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2), ($3))","params":["1","1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[ ["1","1","visible one","alpha-secret","open"], ["2","1","visible two","beta-secret","locked"] ]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["status",25]],"rows":[["1","1","visible one","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "a field the caller cannot read > cannot be written blind either, and is not in the response of a write": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select pg_logical_emit_message(true, $1, $2::text) is not null","params":["protobase_actor","{\"id\":\"tester\",\"roles\":[\"admin\"]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["?column?",16]],"rows":[["t"]]}}, {"sql":"with written as (insert into \"ledger\" (\"title\", \"secret\", \"status\", \"organization_id\") values ($1, $2, $3, $4) returning *) select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from written as t","params":["by admin","gamma-secret","open","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["3","1","by admin","gamma-secret","open"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "record permissions > say per record, and per field, what the caller may do": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["status",25]],"rows":[["1","1","visible one","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "record permissions > are on each list item, and the same rule is enforced on writes": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"secret\" as \"secret\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 order by \"t\".\"id\" asc limit $2","params":["1","3"],"result":{"command":"SELECT","rowCount":3,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25],["__pb_key0",25]],"rows":[ ["1","1","visible one","alpha-secret","open","1"], ["2","1","visible two","beta-secret","locked","2"], ["3","1","by admin","gamma-secret","open","3"] ]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1","params":["1"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.02,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"(t.organization_id = 1)\"\n }\n }\n]"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2), ($3))","params":["1","1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[ ["1","1","visible one","alpha-secret","open"], ["2","1","visible two","beta-secret","locked"] ]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2), ($3))","params":["1","1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[ ["1","1","visible one","alpha-secret","open"], ["2","1","visible two","beta-secret","locked"] ]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), pg_logical_emit_message(true, $3, $4::text) is not null","params":["statement_timeout","1000","protobase_actor","{\"id\":\"tester\",\"roles\":[\"admin\"]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["?column?",16]],"rows":[["1s","t"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1 for update","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}}, {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), pg_logical_emit_message(true, $3, $4::text) is not null","params":["statement_timeout","1000","protobase_actor","{\"id\":\"tester\",\"roles\":[\"admin\"]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["?column?",16]],"rows":[["1s","t"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1 for update","params":["1","2"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["2","1","visible two","beta-secret","locked"]]}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "record permissions > can be switched off per resource": { "(hooks)#0": [ {"sql":"select relkind from pg_class where oid = to_regclass($1)","params":["\"ledger\""],"result":{"command":"SELECT","rowCount":1,"columns":[["relkind",18]],"rows":[["r"]]}}, {"repeated":0}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"t\".\"id\" as \"id\", \"t\".\"organization_id\" as \"organizationId\", \"t\".\"title\" as \"title\", \"t\".\"secret\" as \"secret\", \"t\".\"status\" as \"status\", \"t\".\"id\"::text as \"__pb_key0\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1 order by \"t\".\"id\" asc limit $2","params":["1","2"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25],["__pb_key0",25]],"rows":[ ["1","1","visible one","alpha-secret","open","1"], ["2","1","visible two","beta-secret","locked","2"] ]}}, {"sql":"EXPLAIN (VERBOSE, FORMAT JSON) select 1 as \"one\" from \"ledger\" as \"t\" where \"t\".\"organization_id\" = $1","params":["1"],"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\": \"ledger\",\n \"Schema\": \"public\",\n \"Alias\": \"t\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 1.02,\n \"Plan Rows\": 1,\n \"Plan Width\": 4,\n \"Disabled\": false,\n \"Output\": [\"1\"],\n \"Filter\": \"(t.organization_id = 1)\"\n }\n }\n]"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}} ] }, "a hidden field, to a caller who may use the resource > is refused on update exactly like an unknown field": { "(hooks)#0": [ {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), pg_logical_emit_message(true, $3, $4::text) is not null","params":["statement_timeout","1000","protobase_actor","{\"id\":\"tester\",\"roles\":[\"viewer\"]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["?column?",16]],"rows":[["1s","t"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1 for update","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}}, {"sql":"begin","result":{"command":"BEGIN","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true), pg_logical_emit_message(true, $3, $4::text) is not null","params":["statement_timeout","1000","protobase_actor","{\"id\":\"tester\",\"roles\":[\"viewer\"]}"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25],["?column?",16]],"rows":[["1s","t"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1 for update","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"sql":"rollback","result":{"command":"ROLLBACK","rowCount":null,"columns":[],"rows":[]}} ] }, "a hidden field, to a caller who may use the resource > cannot be seen changing: the ETag covers the readable fields only": { "(hooks)#0": [ {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["status",25]],"rows":[["1","1","visible one","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret","open"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"update ledger set secret = secret || '!' where id = 1","result":{"command":"UPDATE","rowCount":1,"columns":[],"rows":[]}}, {"sql":"start transaction read only","result":{"command":"START","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select set_config($1, $2, true)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["status",25]],"rows":[["1","1","visible one","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret!","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret!","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and \"id\" = $2 limit 1","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret!","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret!","open"]]}}, {"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)","params":["statement_timeout","1000"],"result":{"command":"SELECT","rowCount":1,"columns":[["set_config",25]],"rows":[["1s"]]}}, {"sql":"select \"id\" as \"id\", \"organization_id\" as \"organizationId\", \"title\" as \"title\", \"secret\" as \"secret\", \"status\" as \"status\" from \"ledger\" as t where \"organization_id\" = $1 and (\"id\") in (($2))","params":["1","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",23],["organizationId",23],["title",25],["secret",25],["status",25]],"rows":[["1","1","visible one","alpha-secret!","open"]]}}, {"sql":"commit","result":{"command":"COMMIT","rowCount":null,"columns":[],"rows":[]}}, {"sql":"update ledger set secret = rtrim(secret, '!') where id = 1","result":{"command":"UPDATE","rowCount":1,"columns":[],"rows":[]}} ] } }