Skip to content

Database size is not reduced after deleting records. #1499

Answered by simolus3
rajagopalx asked this question in Q&A
Discussion options

You must be logged in to vote

You can just use customStatement('VACUUM') in your database to execute this command.

If you want to enable the auto_vacuum pragma, a good place to do that is in the beforeOpen callback of your migration:

MigrationStrategy(
  // onCreate, onUpdate, ...
  beforeOpen: (details) async {
    await customStatement('pragma auto_vacuum = 1');
  }
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rajagopalx
Comment options

Answer selected by rajagopalx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants