Skip to content
pubscout

stormberry

0.18.0, released a year ago by schultek.dev

Strongly-typed postgres ORM providing easy bindings between Dart classes and PostgreSQL databases.

$ flutter pub add stormberry
Source repository

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.

  • drift

    If you need a robust SQLite-based local database solution instead of a remote PostgreSQL database.

Works with

Packages commonly used together with stormberry: ones it builds on, ones built on it, and its own family.