dart_neo4j 0.0.2 copy "dart_neo4j: ^0.0.2" to clipboard
dart_neo4j: ^0.0.2 copied to clipboard

A comprehensive Neo4j driver for Dart supporting both bolt:// and neo4j:// URI schemes with type-safe result access.

example/dart_neo4j_example.dart

import 'package:dart_neo4j/dart_neo4j.dart';

void main() async {
  // Create a driver
  final driver = Neo4jDriver.create(
    'bolt://localhost:7687',
    auth: BasicAuth('neo4j', 'password'),
  );

  try {
    // Verify connectivity
    await driver.verifyConnectivity();
    print('Connected to Neo4j!');

    // Create a session
    final session = driver.session();

    try {
      // Run a simple query
      final result = await session.run(
        'RETURN "Hello, Neo4j!" as greeting, 42 as answer',
      );

      // Process results
      await for (final record in result.records()) {
        final greeting = record.getString('greeting');
        final answer = record.getInt('answer');
        print('$greeting The answer is $answer');
      }

      // Get query summary
      final summary = await result.summary();
      print(
        'Query executed in ${summary.resultAvailableAfter?.inMilliseconds ?? 0}ms',
      );
    } finally {
      await session.close();
    }
  } finally {
    await driver.close();
  }
}
3
likes
0
points
25
downloads

Publisher

verified publisherex3.dev

Weekly Downloads

A comprehensive Neo4j driver for Dart supporting both bolt:// and neo4j:// URI schemes with type-safe result access.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dart_bolt

More

Packages that depend on dart_neo4j