Reputation: 1682
I'd like to use the sqlite3_limit function to set the max number of attached Databases.
sqlite3_limit(db, SQLITE_LIMIT_ATTACHED, 62);
Question 1 - How (if at all) can I perform this operation in Android?
I have read here http://sqlite.org/limits.html - point 11.
That there is a soft limit of 10 Attached Databases by default, however I have just attached 11 databases successfully.
Question 2 - What is the default behaviour of max Attached Databases on Android? - Is it set to the hard limit imposed by SQlite3 of 62? If so this is all I need.
Thanks Y'All
Upvotes: 4
Views: 960
Reputation: 180290
sqlite3_limit
can only be used to lower the limit:
Run-time limits are intended for use in applications that manage both their own internal database and also databases that are controlled by untrusted external sources. [...] The internal databases can be given the large, default limits. Databases managed by external sources can be given much smaller limits designed to prevent a denial of service attack.
The hard limit is set with the symbol SQLITE_MAX_ATTACHED
when compiling SQLite:
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. [...] Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound.
It appears that on your Android device, the vendor did indeed increase the hard limit, but you have no guarantee that this is the case on every other device.
Upvotes: 4