Registry / database / graphdb-migration-tool-ex

graphdb-migration-tool-ex

JSON →
library0.0.2jsnpmunverified

A CLI and library for migrating data from JSON and SQL sources to graph databases (Gremlin-compatible, e.g., Azure Cosmos DB). Current version 0.0.2, stable but low release cadence. Supports JSON-to-Gremlin, JSON-to-graph, and SQL-to-graph conversion using Handlebars templates. Key differentiator: leverages a Vertex-Edge format inspired by Azure Cosmos Graph DB, enabling flexible mapping of flat data to graph structures. Ships TypeScript types. Limited to basic database dialects (mssql, mysql, sqlite, postgres). Minimal ecosystem and documentation, no active maintenance.

npm install graphdb-migration-tool-ex
INSTALL
IMPORT
SIG · GRAPHDB-MIGRATION-
G
graphdb-migration-tool-ex
databasejavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jsonToGraph
import { jsonToGraph } from 'graphdb-migration-tool'
import graphdb from 'graphdb-migration-tool'
Named export. Also available via require: const { jsonToGraph } = require('graphdb-migration-tool').
jsonToGremlin
import { jsonToGremlin } from 'graphdb-migration-tool'
import { jsonToGremlin } from 'graphdb-migration-tool-ex'
Named export. Filename in npm is graphdb-migration-tool-ex, but import uses the package name without '-ex'.
sqlToGraph
import { sqlToGraph } from 'graphdb-migration-tool'
const sqlToGraph = require('graphdb-migration-tool').sqlToGraph
Works with both ESM and CJS. Ensure correct dialect and connection config.

Converts a JSON array of objects to Vertex-Edge format using a Handlebars template.

import { jsonToGraph } from 'graphdb-migration-tool'; import fs from 'fs'; const inputData = [ { "myId": "1", "myName": "abc", "myFriendId": "2", "myFriendName": "xyz", "friendshipLvl": 3 } ]; const template = `{ "vertices":[ { "label": "person", "properties":{ "id": "{{myId}}", "name": "{{myName}}" } }, { "label": "person", "properties":{ "id": "{{myFriendId}}", "name": "{{myFriendName}}" } } ], "edges":[ { "label": "friend", "from": "{{myId}}", "to": "{{myFriendId}}", "properties": { "value" : {{friendshipLvl}} } } ] }`; const result = jsonToGraph(inputData, template); console.log(JSON.stringify(result, null, 2));
Debug
Known issues
deprecatedPackage is no longer actively maintained; last release 0.0.2 (2020).
fix
Consider alternatives like Neo4j ETL or Azure Cosmos DB Data Migration Tool.
affects: >=0.0.0
gotchaSQL config uses 'dialect' property; incorrect dialect causes connection failure.
fix
Use one of: 'mysql', 'sqlite', 'postgres', 'mssql'.
affects: >=0.0.0
gotchaTemplate is parsed with Handlebars; missing or malformed expressions (e.g., missing double braces) result in empty strings.
fix
Ensure template uses {{variable}} syntax and input objects contain corresponding keys.
affects: >=0.0.0
breakingThe NPM package name is 'graphdb-migration-tool-ex', not 'graphdb-migration-tool'.
fix
Install with 'npm i graphdb-migration-tool-ex'.
affects: >=0.0.0
gotchaEdge 'from' and 'to' properties reference vertex IDs as strings; mismatched types cause Gremlin failures.
fix
Ensure vertex id and edge from/to are both strings.
affects: >=0.0.0
Errors
Common errors & fixes
SyntaxError: Invalid or unexpected token
Template contains invalid JavaScript syntax (e.g., unescaped double braces in string).
fix
Use raw template strings or escape braces properly: replace {{ with \{\{ if not intended as placeholder.
ConnectionError: Failed to connect to database
SQL config missing required fields (e.g., host, database) or dialect unsupported.
fix
Ensure config has 'dialect', 'username', 'password', 'host', 'database'.
TypeError: Cannot read property 'vertices' of undefined
Template did not produce a valid vertex-edge JSON (missing vertices/edges keys).
fix
Check template output: must contain 'vertices' array and optionally 'edges' array.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Resources
graphdb-migration-tool-ex — npm install graphdb-migration-tool-ex · libregistry