@@ -15,6 +15,8 @@ export default async (fastify: FastifyInstance) => {
15
15
Headers : { pg : string }
16
16
Querystring : {
17
17
include_system_schemas ?: string
18
+ limit ?: number
19
+ offset ?: number
18
20
}
19
21
} > (
20
22
'/' ,
@@ -25,6 +27,8 @@ export default async (fastify: FastifyInstance) => {
25
27
} ) ,
26
28
querystring : Type . Object ( {
27
29
include_system_schemas : Type . Optional ( Type . String ( ) ) ,
30
+ limit : Type . Optional ( Type . String ( ) ) ,
31
+ offset : Type . Optional ( Type . String ( ) ) ,
28
32
} ) ,
29
33
response : {
30
34
200 : Type . Array ( postgresSchemaSchema ) ,
@@ -37,9 +41,11 @@ export default async (fastify: FastifyInstance) => {
37
41
async ( request , reply ) => {
38
42
const connectionString = request . headers . pg
39
43
const includeSystemSchemas = request . query . include_system_schemas === 'true'
44
+ const limit = request . query . limit
45
+ const offset = request . query . offset
40
46
41
47
const pgMeta = new PostgresMeta ( { ...DEFAULT_POOL_CONFIG , connectionString } )
42
- const { data, error } = await pgMeta . schemas . list ( { includeSystemSchemas } )
48
+ const { data, error } = await pgMeta . schemas . list ( { includeSystemSchemas, limit , offset } )
43
49
await pgMeta . end ( )
44
50
if ( error ) {
45
51
request . log . error ( JSON . stringify ( { error, req : request . body } ) )
0 commit comments