orientdb-schema

0.0.2 • Public • Published

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();
});

/orientdb-schema/

    Package Sidebar

    Install

    npm i orientdb-schema

    Weekly Downloads

    1

    Version

    0.0.2

    License

    ISC

    Last publish

    Collaborators

    • alancnet