Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting the OrientDB database structure in a "command style" format

Tags:

orientdb

The question is - is there any way to export the OrientDB database structure in a command style format, like:

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

etc.

Thanks, Denis

like image 204
Denis Mazourick Avatar asked Aug 15 '13 17:08

Denis Mazourick


1 Answers

There is a command export schema available in orientdb console, it produces 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 output is json, so you can write a script to transform it in whatever you want.

like image 96
Yaroslav Avatar answered Oct 17 '22 02:10

Yaroslav