Sqlite update in 2018r2 - up to 30 attched databases

I read the release notes for the newest version of Xojo and would like something clarifying.

I can’t access the feedback system for whatever reason which is why I’m asking here :

Under ‘New Items / Database Plugins’ it says this :

SQLiteDatabase now allows up to 30 attached databases.

What is an ‘attached database’ ? When I open a new database either in memory or on disk is this limited to 30 separate open databases ?

Thanks !

It’s a way to connect two databases together, and is not a limit on how many SQLiteDatabase objects you can have.
http://documentation.xojo.com/index.php/SQLiteDatabase.AttachDatabase

Ok, I see. This limit appears to be unrelated to my concern.

I’m using an array of type SqLiteDatabase that contains a number of separate in memory databases on a project which has only a couple of databases right now but that will grow a lot in the future.

This is my concern, Is there any limit to the number of open sqlite databases at any one time ?

No, other than available memory I suppose.

techincially, probably not… but if you have the need to open so many DATABASES at once, you might wish to reconsider you design (if you have control over it).

Attached databases can all be accessed via the same SQL query at the same time quite easily… But even when SQLite was limited to 10, I never had more than 3 at any one time

[quote=399768:@Neil McAliece]I read the release notes for the newest version of Xojo and would like something clarifying.

I can’t access the feedback system for whatever reason which is why I’m asking here :

Under ‘New Items / Database Plugins’ it says this :

SQLiteDatabase now allows up to 30 attached databases.

What is an ‘attached database’ ?[/quote]

Here is a sequence of SQL I do to copy a row from one database to another, and give the new row in the destination db a new id. I’ve earlier on connected to the source database and use the handle, dbh, of that source db in these commands. dbexec is my shim method which does error handling:

dbexec (dbh, "attach database ':memory:' as mem") dbexec (dbh, "create table mem.messages as select * from main.messages where absid=" + absid.ToText) dbexec (dbh, "update mem.messages set absid=null") dbexec (dbh, "attach database '" + pathd + "' as dst") dbexec (dbh, "insert into dst.messages select * from mem.messages")

So: I open the source db, attach a memory db; create a table in that memory db and populate it with the row from the source db; update the id in the memory db to be null; then attach the destination db; finally copy the row from the memory db into the destination db and automatically get it a new id value since absid is an “integer primary key” which we set to null in the intermediate step.

You could look up “attach database” at www.sqlite.org, of course.

Thanks for the replies, clears that up for me.

It’s highly unlikely I will ever require such a large number of databases but it’s good to know that there’s no hard limit.