Is there any way to 'shrink' a SQLite DB that is using Property Bags?

M Mark Harbrey 3 years 7 months ago
11 1 0

I have an issue with an ever-increasing database in an app running on Android. I am trying to remove a chunk of data from my DB, using Rhom. The data disappears but, of course, the database itself doesn't resize to reflect this. Is there any way to run VACUUM, or something with a similar effect using a Property Bags model, as opposed to fixed schema (it's too late to easily change at this point)?

Any assistance would be greatly appreciated.

Many thanks.

Please Register or Login to post a reply

1 Replies

J Jon Tara

It doesn't matter if it is using property bag or fixed schema. Either way uses SQLite. Property bag data is just stored in one big table.

You can execute arbitrary SQLite statements using Database.executeSql.

(Take care to make sure the statements you execute are supported, as Rhom uses a rather old version of SQLite.)

I haven't tried vacuum, but presume it would work.

I make extensive use of SQL, including triggers and views. Frankly, I use Rhom very little of late. But I use fixed schema models. SQL is less useful for property bag. But certainly still useful for utilities functionality like this.

It's handy to explore the SQLite database using desktop tools! I use SQLiteBrowser on OSX. You do have to stay aware of the old version, as you will be able to use newer features in your desktop tool that are not present in Rhodes. It's very handy, though for working-out queries. (Again, most useful only if using fixed schema.)

CONTACT
Can’t find what you’re looking for?