c# - 附加限制 > 10

标签 c# sqlite

我遇到了 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/

相关文章:

c# - 错误 CS0019 运算符 '==' 无法应用于类型 'HttpStatusCode' 和 'int' 的操作数

c# - 如何将数据从 List<List<String>> 添加到 ListView

c# - 如何将本地数据库文件添加到 Visual Studio Mac 2017

ruby-on-rails - 如何将数据传递给 Rails 3 中的 IN 查询

sqlite - 一个棘手的 GNU make 问题

c# - 为什么这个开关里面的这个 goto 不起作用?

c# - 这个表达有什么问题?无法将类型 'int' 隐式转换为 'byte'

objective-c - SQLite表达式最大深度限制

sql - 此 SQL 选择代码是否遵循良好实践?

android - 是否有任何工具可以在 android 调试期间监控数据库?