[Solved] - Optimize SQLite Database after Deletion?

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keithglong
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 348
Joined: Sun Jul 03, 2011 2:04 am
Location: Gulf Breeze, Florida

[Solved] - Optimize SQLite Database after Deletion?

Post by keithglong » Tue Aug 18, 2015 11:17 pm

Hi All,

I am currently working on an app with an SQLite database. I am able to add images as blobs without any issues. However, upon removing an image from the database, I notice that the size of the database remains large. Is there a way to optimize (i.e., remove blank space, etc.) an SQLite database upon deletion/modification of data? The database needs to be compressed upon deletion.

In other development environments there are "optimize database" options, so what am I missing with LiveCode?

Thanks, and I am somewhat new to SQLite (having only "dabbled around with it" in the past)...

Best regards,

- Boo
Gulf Breeze, FL
Last edited by keithglong on Tue Aug 18, 2015 11:30 pm, edited 1 time in total.

keithglong
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 348
Joined: Sun Jul 03, 2011 2:04 am
Location: Gulf Breeze, Florida

Re: Optimize SQLite Database after Deletion?

Post by keithglong » Tue Aug 18, 2015 11:29 pm

Solved! You can utilize the following command to optimize an SQLite database:

Code: Select all

revExecuteSQL gDatabaseConnection, VACUUM
Best,

- Boo

Post Reply

Return to “Databases”