UNPKG

morpheus4j

Version:

Morpheus is a migration tool for Neo4j. It aims to be a simple and intuitive way to migrate your database.

21 lines 773 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDatabaseConnection = void 0; const neo4j_driver_1 = require("neo4j-driver"); const getDatabaseConnection = async (dbConfig) => { const connectionUrl = `${dbConfig.scheme}://${dbConfig.host}:${dbConfig.port}`; const neo4jDriver = (0, neo4j_driver_1.driver)(connectionUrl, neo4j_driver_1.auth.basic(dbConfig.username, dbConfig.password)); // Test the connection const session = neo4jDriver.session({ database: dbConfig.database, }); try { await session.run('RETURN 1'); } finally { await session.close(); } return neo4jDriver; }; exports.getDatabaseConnection = getDatabaseConnection; //# sourceMappingURL=connection.js.map