neo4j_dart 0.3.2

Neo4j for Dart

Build Status Coverage Status

A Neo4j driver for Dart. Both a simple driver for executing Cypher queries and an Warehouse adapter that implements the GraphDbSession interface. The previously provided OGM (Object Graph Mapper) is deprecated and is being replaced by Warehouse.

Usage

A simple usage example:

import 'package:neo4j_dart/neo4j_dart.dart';

main() async {
  var db = new Neo4j();
  var result = await db.cypher('''
        Create (dart:Language {dart})-[:connects_to]->(neo4j:Database {neo4j})
        Return id(dart), id(neo4j)
      ''', {
        'dart': { 'name': 'Dart' },
        'neo4j': { 'name': 'Neo4j' },
      });

  print('successfully created two nodes with id ${result['data'][0]['row'].join(' and ')}');
}

See the example or test folder for more example usages and Warehouse for documentation on using the adapter.

Features and bugs

Please file feature requests and bugs at the issue tracker. See waffle for current work status.

Changelog

0.3.2

  • Support executing cypher queries from the browser

0.3.1

  • Support both list contains and string contains matchers

0.3.0

  • Add Warehouse adapter
  • Deprecate OGM

0.2.1

  • Add support for Neo4j 2.2 (2.1 is still supported)

0.2.0

  • Fix UTF-8
  • Support open transactions
  • Support basic HTTP authentication

OGM

  • Store state in a DbSession
  • Fire events when nodes are created, updated or deleted
  • Save all changes in the same transaction
  • Fix crash when storing an object with a mixin
  • Fix inherited relationship properties
  • Add getAll method
  • Support only storing changes in relations (added, removed) and not the node itself

0.1.1

  • Polymorphism in OGM (Support returning and saving subclasses of T in repository)

0.1.0

  • Initial Object Graph Mapper release

0.0.1

  • Initial version
  • Cypher support

example/neo4j_dart.dart

// Copyright (c) 2015, <your name>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library neo4j_dart.example;

import 'package:neo4j_dart/neo4j_dart.dart';

main() async {
  var db = new Neo4j();
  var result = await db.cypher('''
        Create (dart:Language {dart})-[:connects_to]->(neo4j:Database {neo4j})
        Return id(dart), id(neo4j)
      ''', {
      'dart': { 'name': 'Dart' },
      'neo4j': { 'name': 'Neo4j' },
  });

  print('successfully created two nodes with id ${result['data'][0]['row'].join(' and ')}');
}

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  neo4j_dart: "^0.3.2"

2. Install it

You can install packages from the command line:

$ pub get

Alternatively, your editor might support 'pub get'. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:neo4j_dart/neo4j_dart.dart';

Platforms

About

A Neo4j driver for Dart.

Author

Email rasmus@eneman.eu Rasmus Eneman

Homepage

github.com/Pajn/Neo4jDart

Documentation

www.dartdocs.org/documentation/neo4j_dart/0.3.2/

Uploader

pie.or.paj@gmail.com

Published

Oct 10, 2015

Share