Skip to content

A class library used to migrate SQL Server graph database into Neo4j

License

Notifications You must be signed in to change notification settings

munchy-bytes/SQLToNeo4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLToNeo4j

A class library used to migrate SQL Server graph database into Neo4j.

Published Articles

Dependencies

Example

using System;

namespace SQLToNeo4j
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SQLReader reader = new SQLReader("Server=<server name>\\<instance name>;Database=<database name>;Trusted_Connection=yes;"))
            {
                reader.GetNodes();
                reader.GetEdges();
                reader.GetIndexes();
                reader.GetFullTextIndexes();
                reader.GetUniqueConstraints();
                //reader.GetExistenceConstraints(); -- available only in enterprise edition
                //reader.GetNodeKeyConstraints(); -- available only in enterprise edition

                using (Neo4jWriter importer = new Neo4jWriter(new Uri("http://neo4j:neo4j@localhost:7474")))
                {
                    importer.ImportNodes(reader.Nodes);
                    importer.ImportEdges(reader.Edges);
                    importer.ImportIndexes(reader.Indexes);
                    importer.ImportFullTextIndexes(reader.FullTextIndexes);
                    importer.ImportConstraints(reader.UniqueConstraints);
                    //importer.ImportConstraints(reader.ExistenceConstraints); -- available only in enterprise edition
                    //importer.ImportConstraints(reader.NodeKeyConstraints); -- available only in enterprise edition
                }
            }
            }
        }
    }
}

About

A class library used to migrate SQL Server graph database into Neo4j

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages