SQLite As Replacement For Ad Hoc Data Files
Page 31 of 41
[
prev
] [
next
]
Instead of using
open
,
puts
, and
gets
for data I/O, open an SQLite database
Storage for...
User preferences
N most recently accessed files
Event log with automatic expiration
Shared local cache of remote files
Last known location of windows
No need to rewrite the whole file after each change - just do an UPDATE
Structured data storage without having to write a formatter and parser
Changes to the file are atomic and durable
SQLite ensures that two or more applications do not try to change the file at the same instant
On read back, use queries rather than searching through the entire file