Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Frequent Contributor
Posts: 120
Registered: ‎10-13-2015
Accepted Solution

Geopackage database How to merge more than 10 gpkg files

Hi Lukask.


We need to merge multiple gpkg files in one.

For that exist the function "attack database" but have the limitation of 10 files and we need to attack more.




sqlite3 icgc17.gpkg

attach database 'icgc1.gpkg' as 'icgc1';



In sqllite3 exist the constant SQLITE_LIMIT_ATTACHED and aparently is possible to overwrite.

We tried  change unsuccessfully




Any idea?

Can you help us?


Best Regards,




Posts: 298
Registered: ‎11-05-2015

Re: Geopackage database How to merge more than 10 gpkg files

The SQLITE_LIMIT_ATTACHED is a runtime configurable limit which by default is set to 10. The sqlite3_limit(db,SQLITE_LIMIT_ATTACHED,20); is a function invocation you'd need to place in your code linking against the SQLite lib. To change the limit in the sqlite3 shell, you would use:

.limit attached 20

BUT! The SQLITE_LIMIT_ATTACHED has a hard limit that is a compiled constant in the binaries and it's set to 10 as well, so unless you recompile your SQLite binaries with a change SQLITE_MAX_ATTACHED, there is no way to overcome the limit of 10 attached databases.