openblocks icon indicating copy to clipboard operation
openblocks copied to clipboard

Feature request: Add datasource and query libraries export/import

Open ludomikula opened this issue 2 years ago • 5 comments

Add ability to export and import datasources and query libraries. This would make it a lot easier for devops when installing/migrating/upgrading openblocks with apps. It would also be easier to spin up a QA/Test environment with an application (in CI/CD pipeline or just for a developer).

ludomikula avatar Feb 06 '23 16:02 ludomikula

Hi @ludomikula. For query libraries, you can import/export queries from/to JSON files (new feature in v1.1.3). Currently it's only possible to operate one query every single time. For data sources, export/import ability is not supported because it may cause database credentials to be leaked.

YoJayz avatar Feb 08 '23 09:02 YoJayz

Yes I am aware about the import/export of one query library, however that's not very practical. I can see the problem with leaked credentials, but this could be handled by removing credentials during export.

Maybe creating an openblocks-ctl command line utility (or enhancing existing openblocks-cli) would make more sense? The security considerations would be gone, since if somebody has access to the underlying system, you're in trouble anyway :)

Something like: openblocks-ctl export datasource [name,name2,name3] - without list of names, exports all datasources openblocks-ctl export query-library [name,name2,name3] - without list of names, exports all query libraries

And similar commands for importing them.

ludomikula avatar Feb 08 '23 10:02 ludomikula

Nice idea. Really appreciate that 😃 Back to your initial needs of installing/migrating/upgrading openblocks with apps, we agree on the difficulty in migrating between multiple Openblocks environments. Actually, we're planning to introduce a new concept called "project". In an Openblocks "project", there are app pages, query library, modules, data sources, etc. Then you can export/import those content in bulk by utilizing the "project" feature. Maybe this is of some help to you?

YoJayz avatar Feb 08 '23 11:02 YoJayz

Yes! That would be definitely helpful. Even more if exposed via an API endpoint :) (but would help a lot even without it)

ludomikula avatar Feb 08 '23 12:02 ludomikula

Hopefully the proposed project feature will fix app and module import export issues mentioned in https://github.com/openblocks-dev/openblocks/issues/94#issuecomment-1426617552

abulka avatar Feb 12 '23 01:02 abulka