in migration/bring-your-own-gdc-assets/bring_your_own_gdc_assets.py [0:0]
def _get_all_tables_for_a_database(database_name, glue_client):
try:
tables = []
next_token = None
while True:
if next_token:
response = glue_client.get_tables(
DatabaseName=database_name,
NextToken=next_token
)
else:
response = glue_client.get_tables(
DatabaseName=database_name
)
for table in response['TableList']:
tables.append(table)
if 'NextToken' in response:
next_token = response['NextToken']
else:
break
return tables
except ClientError as e:
print(f"Error while retrieving tables in database {database_name} : {e}")
raise e