File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ async function getDbTables(
1515) {
1616 let data ;
1717 try {
18- data = await state . dbInstance . listTables ( ) . promise ( ) ;
18+ data = await getTablesPaginated ( state ) ;
1919 } catch ( err ) {
2020 commit ( 'showResponse' , err ) ;
2121 return ;
@@ -29,6 +29,21 @@ async function getDbTables(
2929 }
3030}
3131
32+ async function getTablesPaginated ( state : any ) {
33+ const params : any = { } ;
34+ const data : { TableNames : string [ ] } = { TableNames : [ ] } ;
35+ do {
36+ const chunk = await state . dbInstance . listTables ( params ) . promise ( ) ;
37+ if ( chunk . LastEvaluatedTableName ) {
38+ params . ExclusiveStartTableName = chunk . LastEvaluatedTableName ;
39+ } else {
40+ delete params . ExclusiveStartTableName ;
41+ }
42+ data . TableNames = [ ...data . TableNames , ...chunk . TableNames ] ;
43+ } while ( params . ExclusiveStartTableName ) ;
44+ return data ;
45+ }
46+
3247function deleteTableFromStore (
3348 { commit } : ActionContext < RootState , RootState > ,
3449 tableName : string ,
You can’t perform that action at this time.
0 commit comments