我遇到了 sqlite 数据库程序的问题。我试图将 30 个数据库连接在一起并遇到 10 个错误的限制: “SQLite 错误 附加的数据库过多 - 最多 10"
根据 http://www.sqlite.org/c3ref/limit.html我们应该能够将允许附加数据库的最大数量设置为超过 10 个。我正在使用 C# 和 system.data.sqlite.dll 作为接口(interface)。有谁知道我如何设置上限 > 10?
最佳答案
来自implementation limits页面(强调我的):
The maximum number of attached databases can be lowered at run-time using the
sqlite3_limit(db,SQLITE_LIMIT_ATTACHED,size)
interface.
来自Run-time limits页:
For each limit category SQLITE_LIMIT_NAME there is a hard upper bound set at compile-time by a C preprocessor macro called SQLITE_MAX_NAME. (The
_ LIMIT _
in the name is changed to_ MAX _
.) Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound.
基于你只能降低限制的事实,我认为 SQLITE_LIMIT_ATTACHED
是一个设置为 10 的编译常量。如果你想让它更大,你必须在源代码并重新编译 SQLite。
还有更多:
The code generator in SQLite uses bitmaps to keep track of attached databases. That means that the number of attached databases cannot be increased above 62.
给你。即使你让它大于 10,由于数据库的架构,62 也是一个物理硬限制。
关于c# - 附加限制 > 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9845448/