I'm working on a project that should benefit greatly from using one database file per each table, mostly because I'm trying to avoid having the database grow too large but also because of file locking issues.
I thought of using the ATTACH
statement to have a "virtual" database with all my tables, but I just found out that while the upper limit of attached databases is 62 (which would be totally acceptable for me), the default limit of attached databases is in fact 10, from the SQLite limits page:
Maximum Number Of Attached Databases
The ATTACH statement is an SQLite extension that allows two or more databases to be associated to the same database connection and to operate as if they were a single database. The number of simultaneously attached databases is limited to SQLITE_MAX_ATTACHED which is set to 10 by default. 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.
Since I will need to support more than 10 tables, my question is, how do I set the SQLITE_MAX_ATTACHED
variable to a higher value from PHP (using PDO with SQLite 3)?
These limits are compile-time options.
You must recompile PHP to change them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With