How to switch "bucket" within the same instance?
Currently the a SQLGrid instance is instantiated per bucket (const bucket = SQLGrid()). What's the best strategy to "change" to a different bucket on the fly?
The short answer is, you can't.
A bucket is just a set of database tables for writing files.
Why do you need more than one though?
pseudo-multi-tenancy :P
As a suggestion....
Treat your filenames like paths.
Ex: filename = '/USERNAME/some-file.jpg'
It’s not ideal. With the ability of table replication policy from CockroachDB, it’s possible to have a situation where you want a separate bucket within the same SQLGrid instance.
I see, like GDPR compliance?
How many buckets are we talking about 20? 1000?