dart_neo4j_ogm 0.2.0
dart_neo4j_ogm: ^0.2.0 copied to clipboard
Annotations for Neo4j Object-Graph Mapping (OGM) code generation in Dart.
0.2.0 #
BREAKING CHANGES #
- Mandatory CypherId ID Fields: All
@cypherNodeclasses now require aCypherId idfield instead ofintorString - Removed fromCypherMap: Replaced
fromCypherMapfactory withfromNodefactory for Neo4j Node integration - Automatic ID Exclusion: ID fields are now automatically excluded from Cypher properties regardless of annotations
New Features #
- CypherId Type: Added type-safe
CypherIdsealed class for handling Neo4j node identitiesCypherId.none()for new nodes without IDsCypherId.value(int)for existing nodes with Neo4j-generated IDs- Built-in JSON serialization support with
cypherIdToJsonandcypherIdFromJsonhelpers
- fromNode Factory: New factory method for creating instances from Neo4j
Nodeobjects- Extracts ID from
node.idand properties fromnode.properties - Handles property mapping and type conversion automatically
- Validates required fields and handles nullable properties
- Extracts ID from
- Enhanced JSON Support: Full integration with json_serializable for dual JSON/Cypher serialization
Improvements #
- Better Documentation: Comprehensive README with examples, API reference, and integration guides
- Freezed + JSON Integration: Complete examples for using Freezed with json_serializable
- Error Handling: Improved error messages and validation for missing required fields
- Type Safety: Enhanced compile-time type checking with CypherId system
Documentation #
- Added mandatory ID field requirements section
- Added complete Neo4j integration examples
- Added JSON serialization examples with Freezed
- Updated all code examples to use CypherId
- Added fromNode factory usage documentation
- Corrected license information (GPL v3.0)
0.1.0 #
- Initial release of dart_neo4j_ogm package
- Added @cypherNode annotation for marking classes for OGM code generation
- Added @CypherProperty annotation for controlling field-level Cypher generation behavior