stormberry
0.18.0, released a year ago by schultek.dev
Strongly-typed postgres ORM providing easy bindings between Dart classes and PostgreSQL databases.
What it does
Stormberry maps Dart classes to a PostgreSQL database using annotations and code generation. It supports all kinds of relations without complex configuration and handles database migrations.
AI-written summary of version 0.18.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a Dart or Flutter backend that uses PostgreSQL.
- You want strongly-typed database models and automatic code generation for relations and queries.
Skip it when
- You are using a non-relational database or a SQL database other than PostgreSQL.
- You prefer writing raw SQL queries or manual mappers without code generation.
Strengths
- Strongly-typed models and repositories
- Easy relation handling without complex configuration
- Built-in database migration tool
Weaknesses
- Requires re-running build_runner for model changes
- Strictly limited to PostgreSQL databases
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 12
Add stormberry and build_runner, set up annotated model classes with part files, run build_runner, and use the stormberry migrate tool.
import 'package:stormberry/stormberry.dart';
part 'model.schema.dart';
@Model()
abstract class User {
@PrimaryKey()
String get id;
String get name;
}Alternatives
Packages that do the same job and could replace stormberry.
Works with
Packages commonly used together with stormberry: ones it builds on, ones built on it, and its own family.
- analyzerstormberry depends on itPerforms static analysis of Dart code for tool integration and embedding.
- yamlstormberry depends on itA Dart library for parsing YAML documents into Dart data structures.
- cryptostormberry depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- globstormberry depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- dart_stylestormberry depends on itProvides an API and CLI to format Dart source code automatically.
- argsstormberry depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- filestormberry depends on itPluggable, mockable file system abstraction for Dart with in-memory support.
- buildstormberry depends on itPackage for authoring build_runner compatible code generators.