neo4j_dart 0.3.2

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

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

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages 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

We analyzed this package on Apr 9, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.46.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
27 / 100
Health:
Code health derived from static analysis. [more]
52 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
29
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:neo4j_dart/neo4j_dart.dart.

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 21 errors 1 warning 24 hints.

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

    line: 314 col: 22
    The type 'Map<String, List<Map>>' used in the 'for' loop must implement Iterable.

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

    line: 48 col: 28
    The return type 'Is' isn't a 'bool', as defined by the method '=='.

    Similar analysis of the following files failed:

    • lib/src/ogm/mirrors.dart (error)
    • lib/src/statement.dart (error)
    • lib/src/transaction.dart (error)
    • lib/src/warehouse/db_session.dart (error)
    • lib/src/warehouse/object_builder.dart (error)
    • lib/src/warehouse/where_clause.dart (error)
    • lib/src/db.dart (hint)
    • lib/src/ogm/node.dart (hint)
    • lib/src/ogm/relation.dart (hint)
    • lib/src/ogm/repository.dart (hint)
    • lib/src/warehouse/edge_pattern.dart (hint)
    • lib/src/warehouse/repository.dart (hint)
  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

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.29.0+1
warehouse >=0.1.2 <0.2.0 0.1.2
Transitive dependencies
async 2.0.6
charcode 1.1.1
collection 1.14.9
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.2
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
guinness any
unittest >=0.11.0 <0.12.0