@@ -141,16 +141,36 @@ describe('/types', () => {
141141 assert . equal ( true , ! ! included )
142142 } )
143143} )
144- describe ( '/tables & /columns' , async ( ) => {
145- it ( 'GET /tables' , async ( ) => {
144+ describe ( '/functions' , ( ) => {
145+ it ( 'GET' , async ( ) => {
146+ const res = await axios . get ( `${ URL } /functions` )
147+ // console.log('res.data', res.data)
148+ const datum = res . data . find ( ( x ) => x . schema == 'public' )
149+ const notIncluded = res . data . find ( ( x ) => x . schema == 'pg_toast' )
150+ assert . equal ( res . status , STATUS . SUCCESS )
151+ assert . equal ( true , ! ! datum )
152+ assert . equal ( true , ! notIncluded )
153+ } )
154+ it ( 'GET with system functions' , async ( ) => {
155+ const res = await axios . get ( `${ URL } /functions?includeSystemSchemas=true` )
156+ // console.log('res.data', res.data)
157+ const datum = res . data . find ( ( x ) => x . schema == 'public' )
158+ const included = res . data . find ( ( x ) => x . schema == 'pg_catalog' )
159+ assert . equal ( res . status , STATUS . SUCCESS )
160+ assert . equal ( true , ! ! datum )
161+ assert . equal ( true , ! ! included )
162+ } )
163+ } )
164+ describe ( '/tables' , async ( ) => {
165+ it ( 'GET' , async ( ) => {
146166 const tables = await axios . get ( `${ URL } /tables` )
147167 const datum = tables . data . find ( ( x ) => `${ x . schema } .${ x . name } ` === 'public.users' )
148168 const notIncluded = tables . data . find ( ( x ) => `${ x . schema } .${ x . name } ` === 'pg_catalog.pg_type' )
149169 assert . equal ( tables . status , STATUS . SUCCESS )
150170 assert . equal ( true , ! ! datum )
151171 assert . equal ( true , ! notIncluded )
152172 } )
153- it ( '/tables should return the columns' , async ( ) => {
173+ it ( 'should return the columns, grants, and policies ' , async ( ) => {
154174 const tables = await axios . get ( `${ URL } /tables` )
155175 const datum = tables . data . find ( ( x ) => `${ x . schema } .${ x . name } ` === 'public.users' )
156176 const idColumn = datum . columns . find ( ( x ) => x . name === 'id' )
@@ -161,11 +181,8 @@ describe('/tables & /columns', async () => {
161181 assert . equal ( idColumn . is_updatable , true )
162182 assert . equal ( idColumn . is_identity , true )
163183 assert . equal ( nameColumn . is_identity , false )
164- } )
165- it ( '/tables should return the grants' , async ( ) => {
166- const tables = await axios . get ( `${ URL } /tables` )
167- const datum = tables . data . find ( ( x ) => `${ x . schema } .${ x . name } ` === 'public.users' )
168184 assert . equal ( datum . grants . length > 0 , true )
185+ assert . equal ( datum . policies . length == 0 , true )
169186 } )
170187 it ( '/tables should return the relationships' , async ( ) => {
171188 const tables = await axios . get ( `${ URL } /tables` )
0 commit comments