orientdb-schema
v0.0.2
Published
Deploys a schema to an OrientDB database
Downloads
5
Readme
orientdb-schema
Deploys a schema to an OrientDB database.
Usage:
const schemaMaker = require('orientdb-schema');
const { ODatabase } = require('orientjs');
const db = new ODatabase(...);
const plan = schemaMaker(db, [
{
"name": "Player",
"superClass": "V",
"properties": [
{ "name": "name", "type": "String" },
...
],
"indexes": [
{ "name": "Player.name", "type": "unique", properties: ["name"] }
]
},
...
]);
console.log(plan.explain());
plan.execute().then(() => {
console.log("Done!");
db.close();
});