Increasing Limit of Attached Databases in SQLite from PDO <p>I'm working on a project that should benefit greatly from using one database file per each table, mostly because I'm trying to <a href="http://stackoverflow.com/a/811862/89771">avoid having the database grow too large</a> but also because of <a href="http://stackoverflow.com/a/1712873/89771">file locking issues</a>.</p> <p>I thought of using the <a href="http://www.sqlite.org/lang_attach.html" rel="nofollow"><code>ATTACH</code> statement</a> 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 <a href="http://www.sqlite.org/limits.html" rel="nofollow">SQLite limits page</a>:</p> <blockquote> <p><strong>Maximum Number Of Attached Databases</strong></p> <p>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.</p> </blockquote> <p>Since I will need to support more than 10 tables, my question is, how do I set the <code>SQLITE_MAX_ATTACHED</code> variable to a higher value from PHP (using PDO with SQLite 3)?</p>