["set search_path to _global,public","0E0","data"] ["select count(*) from pg_tables where tablename = '_general' and schemaname = '_global'",[["1"]],"data"] ["select version from _global._general limit 1",[["0.009"]],"data"] ["set lc_messages to \"C\";","0E0","data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] ["set search_path to tester,public","0E0","data"] [" select id from _roles where name = 'Admin' and password = '5f4dcc3b5aa765d61d8327deb882cf99' limit 1; ",[["1"]],"data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select c.relname as name, obj_description(c.oid, 'pg_class') as description from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' order by c.oid",[],"data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select name from _views ",[],"data"] ["truncate _views;","0E0","data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select count(*) from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' ",[["0"]],"data"] [" select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' and c.relname = 'City' limit 1 ",[],"data"] [" create table \"City\" (id serial primary key , \"name\" text , \"parent\" integer default ( 0 ) ); grant select on table \"City\" to anonymous; comment on table \"City\" is 'City'; comment on column \"City\".id is 'ID';comment on column \"City\".\"name\" is 'Name';comment on column \"City\".\"parent\" is 'Parent';","0E0","data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' and c.relname = 'City' limit 1 ",[["944385"]],"data"] [" select count(*) from \"City\" ",[["0"]],"data"] [" select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' and c.relname = 'City' limit 1 ",[["944385"]],"data"] [" select a.attname as name from pg_catalog.pg_attribute a where a.attnum > 0 and not a.attisdropped and a.attname <> 'id' and a.attrelid = (select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relname ='City' and n.nspname = 'tester') order by a.attnum ",[["name"],["parent"]],"data"] ["insert into \"City\" (\"name\") values ('北京市');\ninsert into \"City\" (\"parent\", \"name\") values ('1', '朝阳');\ninsert into \"City\" (\"parent\", \"name\") values ('1', '宣武');\n",1,"data"] ["select max(id) from \"City\"",[["3"]],"data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] ["select count(*) from _views",[["0"]],"data"] [" select id from _views where name = 'Children' limit 1; ",[],"data"] [" select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' and c.relname = 'City' limit 1 ",[["944385"]],"data"] [" select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' and c.relname = 'City' limit 1 ",[["944385"]],"data"] [" insert into _views (name, definition, description) values('Children', 'select * from City where parent in (select id from City where name like $city || ''%'') order by id', NULL) ",1,"data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select id from _views where name = 'Children' limit 1; ",[["1"]],"data"] ["select definition from _views where name = 'Children'",[["select * from City where parent in (select id from City where name like $city || '%') order by id"]],"data"] ["select * from \"City\" where \"parent\" in ( select \"id\" from \"City\" where \"name\" like '北京' || '%' ) order by \"id\"",[{"parent":"1","name":"朝阳","id":"2"},{"parent":"1","name":"宣武","id":"3"}],"data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select id from _views where name = 'Children' limit 1; ",[["1"]],"data"] [" select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' and c.relname = 'City' limit 1 ",[["944385"]],"data"] [" select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' and c.relname = 'City' limit 1 ",[["944385"]],"data"] ["update _views\nset definition = 'select name from City where parent = (select id from City where name like $city || ''%'') order by id'\nwhere name = 'Children';\n",1,"data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select id from _views where name = 'Children' limit 1; ",[["1"]],"data"] ["select definition from _views where name = 'Children'",[["select name from City where parent = (select id from City where name like $city || '%') order by id"]],"data"] ["select \"name\" from \"City\" where \"parent\" = ( select \"id\" from \"City\" where \"name\" like '北京' || '%' ) order by \"id\"",[{"name":"朝阳"},{"name":"宣武"}],"data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select id from _views where name = 'Children' limit 1; ",[["1"]],"data"] [" select c.oid from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','') and n.nspname = 'tester' and pg_catalog.pg_table_is_visible(c.oid) and substr(c.relname,1,1) <> '_' and c.relname = 'City' limit 1 ",[["944385"]],"data"] ["update _views\nset definition = 'select blah.name from (select * from City where name like $city || ''%'' order by id) as blah'\nwhere name = 'Children';\n",1,"data"] ["select nspname from pg_namespace where nspname = 'tester' limit 1;\n",1,"data"] [" select id from _views where name = 'Children' limit 1; ",[["1"]],"data"] ["select definition from _views where name = 'Children'",[["select blah.name from (select * from City where name like $city || '%' order by id) as blah"]],"data"] ["select \"blah\".\"name\" from ( select * from \"City\" where \"name\" like '北京' || '%' order by \"id\" ) as blah",[{"name":"北京市"}],"data"]