bavard 0.0.20
bavard: ^0.0.20 copied to clipboard
An Eloquent-inspired ORM for Flutter. Supports SQLite, PostgreSQL and PowerSync with fluent queries, relationships, soft deletes, timestamps, casts and more.
Bavard ORM ๐ฃ๏ธ #
The Eloquent-style ORM for Dart.
Work in Progress: This project is currently under active development. APIs may change.
Bavard brings the elegance and simplicity of Eloquent to the Dart ecosystem. It is designed to provide a fluent, expressive interface for database interactions, prioritizing developer experience, runtime flexibility, and readability.
๐ Key Features #
- ๐ Flutter ready: Seamlessly integrated with Flutter for mobile, desktop, and web applications.
- โก๏ธ Runtime-first architecture: Code generation is 100% optional. Bavard leverages Dart's runtime capabilities and mixins to work entirely without build processes.
- ๐๏ธ Fluent Query Builder: Construct complex SQL queries using an expressive and type-safe interface.
- ๐ Rich Relationship Mapping: Full support for One-to-One, One-to-Many, Many-to-Many, Polymorphic, and HasManyThrough relations.
- ๐งฉ Smart Data Casting: Automatic hydration and dehydration of complex types like JSON, DateTime, and Booleans between Dart and your database.
- ๐ญ Production-ready features: Built-in support for Soft Deletes, Automatic Timestamps, and Global Scopes out of the box.
- ๐ฑ Offline-first ready: Native support for client-side UUIDs and a driver-agnostic architecture, ideal for local-first applications.
- ๐ต๏ธ Dirty Checking: Optimized database updates by tracking only the attributes that have actually changed.
- ๐ Eager Loading: Powerful eager loading system to eliminate N+1 query problems.
- ๐ Database Agnostic: Flexible adapter system with native support for SQLite and PostgreSQL.
๐ Documentation #
For detailed guides, API references, and usage examples, please visit our documentation:
๐งช Examples & Integration #
To see Bavard in action with a real database environment, check the integration suite:
- SQLite + Docker Integration Test
- PostgreSQL + Docker Integration Test
๐ค Contributing #
Bavard is open-source. Feel free to explore the code, report issues, or submit pull requests.