Skip to content

feature(dynamodb): allow to purge full table#21

Open
torbjokv wants to merge 2 commits intomainfrom
dynamodb-purge
Open

feature(dynamodb): allow to purge full table#21
torbjokv wants to merge 2 commits intomainfrom
dynamodb-purge

Conversation

@torbjokv
Copy link
Contributor

@torbjokv torbjokv commented Oct 8, 2025

Usage: cli.py dynamodb purge [OPTIONS] TABLE

  Purge all items from a DynamoDB table.

Options:
  --profile TEXT  The AWS profile to use. e.g. sikt-nva-sandbox, configure
                  your profiles in ~/.aws/config
  --help          Show this message and exit.

Output

$ uv run cli.py dynamodb purge channel-register-cache --profile sikt-nva-prod 


Table Information:
  Profile: sikt-nva-prod
  Table Name: channel-register-cache-master-pipelines-NvaPublicationChannels-ZK1LAAO4HEIW-nva-publication-channels-java
  Status: ACTIVE
  Approximate Item Count: 70355
  Key Schema: PK0, SK0

WARNING: This will delete ALL items from table 'channel-register-cache-master-pipelines-NvaPublicationChannels-ZK1LAAO4HEIW-nva-publication-channels-java'!
Type the full table name to confirm deletion: channel-register-cache-master-pipelines-NvaPublicationChannels-ZK1LAAO4HEIW-nva-publication-channels-java

Starting deletion of all items from 'channel-register-cache-master-pipelines-NvaPublicationChannels-ZK1LAAO4HEIW-nva-publication-channels-java'...
Deletion in progress... 4133 items deleted
Deletion in progress... 6195 items deleted
Deletion in progress... 8272 items deleted
Deletion in progress... 10368 items deleted
Deletion in progress... 12452 items deleted
Deletion in progress... 14513 items deleted
Deletion in progress... 16596 items deleted
Deletion in progress... 18693 items deleted
Deletion in progress... 20773 items deleted
Deletion in progress... 22833 items deleted
Deletion in progress... 24920 items deleted
Deletion in progress... 26994 items deleted
Deletion in progress... 29064 items deleted
Deletion in progress... 31126 items deleted
Deletion in progress... 33210 items deleted
Deletion in progress... 35305 items deleted
Deletion in progress... 37407 items deleted
Deletion in progress... 39501 items deleted
Deletion in progress... 41560 items deleted
Deletion in progress... 43657 items deleted
Deletion in progress... 45738 items deleted
Deletion in progress... 47841 items deleted
Deletion in progress... 49918 items deleted
Deletion in progress... 51992 items deleted
Deletion in progress... 54037 items deleted
Deletion in progress... 56132 items deleted
Deletion in progress... 58217 items deleted
Deletion in progress... 60305 items deleted
Deletion in progress... 62361 items deleted
Deletion in progress... 64439 items deleted
Deletion in progress... 66496 items deleted
Deletion in progress... 68563 items deleted
Deletion in progress... 70355 items deleted

✓ Successfully deleted 70355 items from 'channel-register-cache-master-pipelines-NvaPublicationChannels-ZK1LAAO4HEIW-nva-publication-channels-java'

Copy link

@truhacevkir truhacevkir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe split the table into segments and scan them concurrently, as you implemented in batch scan? Will delete large tables much faster :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants