I want to create sqlite partition structure, I created 3 databases, I attached those 3 databases to another database which will be parent with
ATTACH DATABASE '1.db' as 1
ATTACH DATABASE '2.db' as 2
ATTACH DATABASE '3.db' as 3
after i .quit
the parent database the database attachments detach, How can I keep them attached even if I quit the database?
Thanks.
Attachments are never permanent.
Every program that opens the database needs to make any attachments it needs.
If you really think you need partitioning, using another database might be a better idea.
Attachments are not permanent.
When partitioning a SQLITE database, the natural way to do it is to create a separate database for each X, where X is some element in the system that represents a query boundary that you don't need to cross.
For example, you can create a separate database for each user.
Or you can hash to 2 bytes on some key, and create a database for each pair of bytes, ameliorating lock contention.
If you don't have a natural partition in your data, and you need to scale beyond the capabilities of sqlite, you should consider another DB.
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