You could look at the Sqlite data structures and write a program to build the free pages list. I still don't understand why you need to pre-allocate space.

If you are using Linux or Unix you can make a file system of a fixed size for the DB. On Windows you could partition the disk into a drive for the DB. If you are using something else you may have disk partitioning capabilities in the file system.

You could modify Sqlite to check for the file size whenever it allocates new file space and return a disk full status when it exceeds the quota you have set.

You could define a trigger on INSERT and DELETE to keep a running total of rows in the DB and check the total before you perform an INSERT.

kamil wrote:
I want to preallocate disk space for database. I have only one table with ~1 milion entries, each entry takes about 30 bytes. Entries are added/removed but there is some maximum number of items, which can be put into the table at the same time. Is it possible to allocate a fixed disk space for such database ? How large should it be ? If yes, then is there a better way to create large files than massive insterts/deletes ?

Thanks in advance,
Kamil


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to