SQLite数据库的大小有限制吗?

前端之家收集整理的这篇文章主要介绍了SQLite数据库的大小有限制吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经阅读了他们的限制常见问题,他们谈论了许多限制,除了整个数据库的限制。
implementation limits页可以很容易地推断出这一点:

An sqlite database file is organized as pages. The size of each page is a power of 2 between 512 and sqlITE_MAX_PAGE_SIZE. The default value for sqlITE_MAX_PAGE_SIZE is 32768.

The sqlITE_MAX_PAGE_COUNT parameter,which is normally set to 1073741823,is the maximum number of pages allowed in a single database file. An attempt to insert new data that would cause the database file to grow larger than this will return sqlITE_FULL.

所以我们有32768 * 1073741823,这是35,184,372,056,064(35万亿字节)!

您可以在源代码修改sqlITE_MAX_PAGE_COUNT或sqlITE_MAX_PAGE_SIZE,但这当然需要为应用程序自定义构建sqlite。据我所知,除编译之外,没有办法以编程方式设置限制(但我很乐意被证明是错误的)。

原文链接:https://www.f2er.com/sqlite/198054.html

猜你在找的Sqlite相关文章