Below is what I do for clearing and compressing my SQLite database files in Qt. Usually when you delete some entries from a SQLite database, it does not get deleted physically but instead it just gets marked as deleted and is not retrieved in queries. The good thing about this is that it works fast. But the obvious downside is the fact that the free space is not released. To release the space occupied by deleted files you need to do the following:
Continue reading “How to Reduce Your SQLite Database File Size Using Qt”How to convert date formats in SQLite
Date types are handled like a string in SQLite and below is an example of how to change the date format from MM/dd/yyyy to yyyy-MM-dd. With a little modification it can be used for other formats too.
select substr(column, 7, 4)||”-“||substr(column, 1,2)||”-“||substr(column, 4,2) from table