Hi, a sqlite database is a file, you can get its size using OS calls. It is not possible to create a database with an initial size, because the file grows dynamically when you insert data.
To avoid fragmentation, I also looked for a way to allocate empty space inside the database file when creating it. Dr. Hipp proposed to create a table with a single Blob-column, insert a very large, empty blob, and then dropping the table. The file will then keep its size and afterwards reuse the empty pages. However, i could not find a way to determine when the empty pages are used up and the file will start to grow again without checking the file size after every insert. Martin gujx schrieb: > Hi, I’d like to ask some question about the interface of the sqlite > resource. > > Whether there is some interface to control the size of a database, for > example, if I want to create a database with 5M initialized, how can I do > that? And when I make change to a database, for example, insert a row to a > table, then can I get the size of the database now? > > > > Looking forward to your answer. > > > > > > Gu Jinxiang > > > > 以上、よろしくお��いします。 > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >
_______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users