neo4j_dart 0.3.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 7

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:

with pub:


$ 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';
        
Version Uploaded Documentation Archive
0.3.2 Oct 10, 2015 Go to the documentation of neo4j_dart 0.3.2 Download neo4j_dart 0.3.2 archive
0.3.1 Sep 20, 2015 Go to the documentation of neo4j_dart 0.3.1 Download neo4j_dart 0.3.1 archive
0.3.0 May 24, 2015 Go to the documentation of neo4j_dart 0.3.0 Download neo4j_dart 0.3.0 archive
0.2.1 May 16, 2015 Go to the documentation of neo4j_dart 0.2.1 Download neo4j_dart 0.2.1 archive
0.2.0 May 4, 2015 Go to the documentation of neo4j_dart 0.2.0 Download neo4j_dart 0.2.0 archive
0.1.1 Mar 26, 2015 Go to the documentation of neo4j_dart 0.1.1 Download neo4j_dart 0.1.1 archive
0.1.0 Mar 18, 2015 Go to the documentation of neo4j_dart 0.1.0 Download neo4j_dart 0.1.0 archive
0.0.1 Mar 14, 2015 Go to the documentation of neo4j_dart 0.0.1 Download neo4j_dart 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
24
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall score:
Weighted score of the above. [more]
7

Platforms

Detected platforms:

Error(s) prevent platform classification.

Suggestions

  • Fix lib/src/ogm/db_session.dart.

    Strong-mode analysis of lib/src/ogm/db_session.dart failed with the following error:

    line: 297 col: 45
    The getter 'type' isn't defined for the class 'Object'.

  • Fix lib/src/ogm/mirrors.dart.

    Strong-mode analysis of lib/src/ogm/mirrors.dart failed with the following error:

    line: 73 col: 67
    The getter 'isGetter' isn't defined for the class 'DeclarationMirror'.

  • Fix further 6 Dart files.

    Similar analysis of the following files failed:

    • lib/src/ogm/is.dart
    • lib/src/statement.dart
    • lib/src/transaction.dart
    • lib/src/warehouse/object_builder.dart
    • lib/src/warehouse/db_session.dart
    • lib/src/warehouse/where_clause.dart

Dependencies

Package Constraint Resolved Available
Direct dependencies
crypto >=0.9.0 <0.10.0 0.9.2+1 2.0.2+1
http >=0.11.1+3 <0.12.0 0.11.3+16
quiver >=0.18.0 <0.22.0 0.21.4 0.26.2
warehouse >=0.1.2 <0.2.0 0.1.2
Transitive dependencies
async 2.0.1
charcode 1.1.1
collection 1.14.3
concepts 0.2.0
constrain 0.2.8
convert 1.1.1 2.0.1
either 0.1.8
http_parser 3.1.1
matcher 0.12.1+4
option 1.2.0
path 1.5.1
source_span 1.4.0
stack_trace 1.9.1
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
guinness any
unittest >=0.11.0 <0.12.0