Export OrientDB database structure in command style format

Question: is there a way to export the OrientDB database structure in command line format, for example:

create database <name> create class <name> create property <name>... 

and etc.

Thanks Denis

+6
source share
2 answers

The orientdb console has an export schema command, it creates something like:

 ... "schema":{ "version":54, "classes":[ { "name":"YourClassName", "default-cluster-id":9, "cluster-ids":[ 9 ], "properties":[ { "name":"f1", "type":"STRING" }, { "name":"f2", "type":"STRING" }, { "name":"f3", "type":"STRING" } ] }, ... 

The result is json, so you can write a script to convert it to what you need.

+1
source

More generally: export database FILENAME export to the (special) JSON format (special, since it is important for keys that the order of the keys is available for OrientDB).

0
source

Source: https://habr.com/ru/post/951819/


All Articles