Wolfgang wrote:I would need something similar to:
Code: Select all
wxSQLite3Database* h_dbi[1024] = new wxSQLite3Database();
In principal you could allocate an array of wxSQLite3Database objects with the following statement:
Code: Select all
wxSQLite3Database* h_dbi = new wxSQLite3Database[1024]();
// Open first connection
h_dbi[0].Open(...);
However, you would still have to open these database instances one by one using the Open method.
Wolfgang wrote:I want to have open a lot of databases at once, it is for a bible programm, and keeping everything in memory would take too much space, at least I think so.
Do you really have
many separate database files? This smells like a bad design for your application.
Usually, one has a single database (or a small number of databases) each holding tables with the actual information. You access the information by querying the requested items from one or more tables.
Wolfgang wrote:How would it be possible to achieve something similar.
The best approach would be to organize the information within a reasonable small number of databases. The number of tables in a database is not limited. However, you can't join more than 64 tables in a single query.
Wolfgang wrote:And what is the limit on open wxsqlite3 Databases?
This is not a limitation of wxSQLite3Database, but a limitation of the underlying operating system. Most operating systems have limitations on the maximum number of files which can be open at the same time. Since SQLite databases are ordinary files, such a limitation holds true for databases as well.
SQLite3 allows to
attach database files to a database connection. The default maximum number of attached databases is 10, but it can be changed to a higher number up to 125.
Regards,
Ulrich